summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/extensions/toggle_row.html
blob: f8cdcb4aee915dfddb3910588afb45a8901fd2f6 (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
<link rel="import" href="chrome://resources/html/polymer.html">

<link rel="import" href="chrome://resources/cr_elements/cr_toggle/cr_toggle.html">
<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html">

<dom-module id="extensions-toggle-row">
  <template>
    <style>
      :host {
        flex-direction: column;
        touch-action: none;
      }

      input {
        display: none;
      }

      label {
        align-items: center;
        box-sizing: border-box;
        cursor: pointer;
        display: flex;
        flex: 1;
        padding: var(--toggle-row-label-vertical-padding, 0)
                 var(--toggle-row-label-horizontal-padding, 0);
        width: 100%;
      }

      cr-toggle {
        display: inline-block;
      }

      :host ::slotted(*) {
        flex: 1;
        margin-inline-end: 20px;
      }
    </style>
    <label id="label">
      <input id="native" type="checkbox" checked="[[checked]]"
          on-change="onNativeChange_" on-click="onNativeClick_"
          disabled="[[disabled]]">
      <slot></slot>
      <cr-toggle id="crToggle" checked="{{checked}}" aria-labelledby="label"
          on-change="onCrToggleChange_" disabled="[[disabled]]"></cr-toggle>
    </label>
  </template>
  <script src="toggle_row.js"></script>
</dom-module>