summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/print_preview/ui/app.html
blob: 2e5816ecc9367050bb07c6c823f16829cfafe62f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<link rel="import" href="chrome://resources/html/polymer.html">

<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/load_time_data.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_outline_manager.html">
<link rel="import" href="chrome://resources/html/util.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="../cloud_print_interface.html">
<link rel="import" href="../cloud_print_interface_manager.html">
<link rel="import" href="../native_layer.html">
<link rel="import" href="../data/destination.html">
<link rel="import" href="../data/document_info.html">
<link rel="import" href="../data/measurement_system.html">
<link rel="import" href="../data/model.html">
<link rel="import" href="../data/state.html">
<link rel="import" href="print_preview_vars_css.html">
<link rel="import" href="strings.html">
<link rel="import" href="settings_behavior.html">
<link rel="import" href="preview_area.html">
<link rel="import" href="sidebar.html">

<dom-module id="print-preview-app">
  <template>
    <style>
      :host {
        display: flex;
        height: 100%;
        user-select: none;
      }

      @media (prefers-color-scheme: dark) {
        :host {
          background: var(--google-grey-900);
        }
      }

      :host([new-print-preview-layout_]) {
        flex-direction: row-reverse;
      }

      print-preview-sidebar {
        flex: none;
        width: var(--print-preview-sidebar-width);
      }

      #preview-area-container {
        align-items: center;
        background-color: var(--preview-area-background-color);
        flex: 1;
      }

      :host([new-print-preview-layout_]) #preview-area-container {
        background-color: var(--preview-area-background-color-new);
      }
    </style>
    <print-preview-state id="state" state="{{state}}" error="{{error_}}">
    </print-preview-state>
    <print-preview-model id="model" settings="{{settings}}"
        controls-managed="{{controlsManaged_}}" destination="[[destination_]]"
        document-settings="[[documentSettings_]]"
        margins="[[margins_]]" page-size="[[pageSize_]]"
        on-preview-setting-changed="onPreviewSettingChanged_"
        on-sticky-setting-changed="onStickySettingChanged_"
        on-setting-valid-changed="onSettingValidChanged_">
    </print-preview-model>
    <print-preview-document-info id="documentInfo"
        document-settings="{{documentSettings_}}" margins="{{margins_}}"
        page-size="{{pageSize_}}">
    </print-preview-document-info>
    <print-preview-sidebar id="sidebar"
        cloud-print-interface="[[cloudPrintInterface_]]"
        cloud-print-error-message="[[cloudPrintErrorMessage_]]"
        destination-state="{{destinationState_}}"
        controls-managed="[[controlsManaged_]]" destination="{{destination_}}"
        error="{{error_}}" new-print-preview-layout="[[newPrintPreviewLayout_]]"
        page-count="[[documentSettings_.pageCount]]"
        settings="[[settings]]" state="[[state]]" on-focus="onSidebarFocus_"
<if expr="is_macosx">
        on-open-pdf-in-preview="onOpenPdfInPreview_"
</if>
<if expr="not chromeos">
        on-print-with-system-dialog="onPrintWithSystemDialog_"
</if>
        on-print-requested="onPrintRequested_"
        on-cancel-requested="onCancelRequested_">
    </print-preview-sidebar>
    <div id="preview-area-container">
      <print-preview-preview-area id="previewArea" settings="[[settings]]"
          destination="[[destination_]]" error="{{error_}}"
          document-modifiable="[[documentSettings_.isModifiable]]"
          margins="[[margins_]]" page-size="[[pageSize_]]" state="[[state]]"
          measurement-system="[[measurementSystem_]]"
          new-print-preview-layout="[[newPrintPreviewLayout_]]"
          preview-state="{{previewState_}}" on-preview-start="onPreviewStart_">
      </print-preview-preview-area>
    </div>
  </template>
  <script src="app.js"></script>
</dom-module>