File: destination_dropdown_cros.html

package info (click to toggle)
chromium 139.0.7258.138-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,120,676 kB
  • sloc: cpp: 35,100,869; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (199 lines) | stat: -rw-r--r-- 6,265 bytes parent folder | download | duplicates (7)
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<style include="cr-shared-style cr-hidden-style">
  /* Dropdown colors are based on md-select colors to align with styling of
     select elements. */
  :host {
    --dropdown-bg-color: var(--google-grey-100);
    --dropdown-focus-shadow-color: rgba(var(--google-blue-600-rgb), .4);
    --dropdown-option-bg-color: white;
  }

  @media (prefers-color-scheme: dark) {
    :host {
      --dropdown-bg-color: rgba(0, 0, 0, 0.3);
      --dropdown-focus-shadow-color: rgba(var(--google-blue-300-rgb), .4);
      --dropdown-option-bg-color: var(--google-grey-900-white-4-percent);
    }
  }

  #destinationDropdown {
    outline: none;
    position: relative;
  }

  #destinationDropdown:focus {
    border-radius: 4px;
    box-shadow: 0 0 0 2px var(--dropdown-focus-shadow-color);
  }

  #destinationDropdown,
  iron-dropdown {
    width: var(--print-preview-dropdown-width);
  }

  iron-dropdown {
    border: 0.5px solid rgba(0, 0, 0, 0.5);
    max-height: 270px;
  }

  iron-dropdown [slot='dropdown-content'] {
    background-color: var(--dropdown-option-bg-color);
    box-shadow: var(--cr-menu-shadow);
    padding: 8px 0;
  }

  #dropdown-icon {
    --iron-icon-height: 24px;
    --iron-icon-width: 44px;
    align-items: center;
    left: 2px;
    margin-inline-start: -4px;
    top: 50%;
  }

  :host-context([dir='rtl']) #dropdown-icon {
    right: 2px;
  }

  #dropdown-box {
    border-radius: 4px;
    height: 100%;
    left: 0;
    margin-top: 24px;
    overflow: hidden;
    pointer-events: initial;
    position: absolute;
    top: 0;
    width: 100%;
  }

  .list-item {
    background: none;
    border: none;
    box-sizing: border-box;
    cursor: pointer;
    font: inherit;
    min-height: 32px;
    padding: 0 8px;
    text-align: start;
    width: 100%;
  }

  .list-item:focus {
    outline: none;
  }

  .list-item.highlighted {
    /* Highlight background color used is Google blue closest to system default
       highlight color. */
    background-color: var(--google-blue-100);
  }

  @media (prefers-color-scheme: dark) {
    .list-item.highlighted {
      --iron-icon-fill-color: currentColor;
      background-color: var(--google-blue-200);
      color: var(--google-grey-900);
    }
  }

  #destination-icon-box,
  .printer-display-name {
    padding-inline-start: 8px;
  }

  #destination-display-container {
    align-items: center;
    background-color: var(--dropdown-bg-color);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    width: 100%;
  }

  :host([disabled]) #destination-display-container {
    cursor: default;
    opacity: var(--cr-disabled-opacity);
  }

  #destination-display {
    box-sizing: border-box;
    overflow: hidden;
    padding-inline-start: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
  }
</style>
<iron-media-query query="(prefers-color-scheme: dark)"
    query-matches="{{isDarkModeActive_}}">
</iron-media-query>
<div id="destinationDropdown" on-keydown="onKeyDown_" tabindex="0"
    on-blur="onBlur_" on-click="onClick_" role="button" aria-haspopup="true"
    aria-label="$i18n{destinationLabel} [[value.displayName]]"
    aria-description$="[[getAriaDescription_(destinationStatusText)]]"
    aria-expanded="[[opened_]]" aria-setsize$="[[dropdownLength_]]">
  <div id="destination-display-container">
    <div id="destination-icon-box">
      <cr-icon icon="[[destinationIcon]]"></cr-icon>
    </div>
    <div id="destination-display" title="[[value.displayName]]">
      [[value.displayName]]
    </div>
    <cr-icon id="dropdown-icon" icon="cr:arrow-drop-down"></cr-icon>
  </div>
  <div id="dropdown-box">
    <iron-dropdown horizontal-align="left" vertical-align="top"
        vertical-offset="0" no-cancel-on-outside-click
        no-cancel-on-esc-key>
      <div slot="dropdown-content">
        <template is="dom-repeat" items="[[itemList]]">
          <button id="[[item.key]]" tabindex="-1" value="[[item.key]]"
              on-click="onSelect_" on-blur="onBlur_" role="menuitem"
              aria-setsize$="[[dropdownLength_]]"
              class$="list-item [[getHighlightedClass_(item.key,
                  highlightedIndex_)]]"
              aria-description$="[[getPrinterStatusErrorString_(
                  item.printerStatusReason)]]"
              aria-posinset$="[[getPrinterPosinset_(index)]]">
            <cr-icon icon="[[getPrinterStatusIcon_(
                item.printerStatusReason, item.isEnterprisePrinter,
                isDarkModeActive_)]]">
            </cr-icon>
            <span class="printer-display-name">[[item.displayName]]</span>
          </button>
        </template>
        <button on-click="onSelect_" tabindex="-1" value="[[pdfDestinationKey]]"
          hidden$="[[pdfPrinterDisabled]]" on-blur="onBlur_" role="menuitem"
          aria-setsize$="[[dropdownLength_]]"
          aria-posinset$="[[pdfPosinset]]"
          class$="list-item [[getHighlightedClass_(pdfDestinationKey,
              highlightedIndex_)]]">
          $i18n{printToPDF}
        </button>
        <button on-click="onSelect_" tabindex="-1" on-blur="onBlur_"
          value="[[driveDestinationKey]]" hidden$="[[!driveDestinationKey]]"
          role="menuitem" aria-setsize$="[[dropdownLength_]]"
          aria-posinset$="[[drivePosinset]]"
          class$="list-item [[getHighlightedClass_(driveDestinationKey,
              highlightedIndex_)]]">
          $i18n{printToGoogleDrive}
        </button>
        <button on-click="onSelect_" tabindex="-1" value="noDestinations"
          hidden$="[[!noDestinations]]" on-blur="onBlur_" role="menuitem"
          aria-setsize$="[[dropdownLength_]]" aria-posinset$="1"
          class$="list-item [[getHighlightedClass_('noDestinations',
              highlightedIndex_)]]">
          $i18n{noDestinationsMessage}
        </button>
        <button on-click="onSelect_" tabindex="-1" value="seeMore"
          aria-label="$i18n{seeMoreDestinationsLabel}" on-blur="onBlur_"
          aria-posinset$="[[seeMorePosinset]]"
          role="menuitem" aria-setsize$="[[dropdownLength_]]"
          class$="list-item [[getHighlightedClass_('seeMore',
              highlightedIndex_)]]">
          $i18n{seeMore}
        </button>
      </div>
    </iron-dropdown>
  </div>
</div>