summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/print_preview/ui/destination_select.html
blob: 2b7cb3cec1736fa9399cdb913b7a619871a6213c (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
<link rel="import" href="chrome://resources/html/polymer.html">

<link rel="import" href="chrome://resources/cr_elements/hidden_style_css.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/cr_elements/md_select_css.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/html/util.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-iconset-svg/iron-iconset-svg.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-meta/iron-meta.html">
<link rel="import" href="../icons.html">
<link rel="import" href="../print_preview_utils.html">
<link rel="import" href="../data/destination.html">
<link rel="import" href="print_preview_shared_css.html">
<link rel="import" href="select_behavior.html">
<link rel="import" href="strings.html">

<dom-module id="print-preview-destination-select">
  <template>
    <style include="print-preview-shared md-select cr-hidden-style">
      :host {
        --printer-icon-side-padding: 4px;
        --printer-icon-size: 20px;
      }

      select.md-select {
        background-position: var(--printer-icon-side-padding) center,
            calc(100% - var(--md-select-side-padding)) center;
        background-size: var(--printer-icon-size), var(--md-arrow-width);
        margin: 2px;
        padding-inline-start: 32px;
        --md-select-width: calc(100% - 4px);
      }

      :host-context([dir=rtl]) .md-select {
        background-position-x: calc(100% - var(--printer-icon-side-padding)),
            var(--md-select-side-padding);
      }
    </style>
    <select class="md-select" aria-label$="[[i18n(destinationLabel)]]"
        style="background-image:
            [[getBackgroundImages_(destination.icon, destinationState, dark)]];"
        disabled$="[[disabled]]"
        value="{{selectedValue::change}}">
      <template is="dom-repeat" items="[[recentDestinationList]]">
        <option value="[[getKey_(item)]]">[[item.displayName]]</option>
      </template>
      <option value="[[getPdfDestinationKey_()]]" hidden$="[[appKioskMode]]">
        $i18n{printToPDF}
      </option>
      <option value="[[getGoogleDriveDestinationKey_(activeUser)]]"
          hidden$="[[!activeUser]]">
        $i18n{printToGoogleDrive}
      </option>
<if expr="chromeos">
      <option value="noDestinations"
              hidden$="[[!noDestinations]]" selected$="[[noDestinations]]">
        $i18n{noDestinationsMessage}
      </option>
</if>
      <option value="seeMore" aria-label$="[[i18n(seeMoreDestinationsLabel)]]">
        $i18n{seeMore}
      </option>
    </select>
  </template>
  <script src="destination_select.js"></script>
</dom-module>