summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/settings/controls/settings_checkbox.html
blob: c5433716c5c1f61b18ef6a29680e041023ab5484 (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
<link rel="import" href="chrome://resources/html/polymer.html">

<link rel="import" href="chrome://resources/cr_elements/cr_checkbox/cr_checkbox.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_indicator.html">
<link rel="import" href="settings_boolean_control_behavior.html">
<link rel="import" href="../settings_shared_css.html">

<dom-module id="settings-checkbox">
  <template>
    <style include="settings-shared">
      #outerRow {
        align-items: center;
        display: flex;
        min-height: var(--settings-row-two-line-min-height);
        width: 100%;
      }

      #outerRow[noSubLabel] {
        min-height: var(--settings-row-min-height);
      }

      cr-checkbox {
        /* Additional margin in case subLabel needs more than one line. */
        margin-bottom: 4px;
        margin-top: var(--settings-checkbox-margin-top, 4px);
        width: 100%;
      }

      cr-policy-pref-indicator {
        margin-inline-start: var(--settings-controlled-by-spacing);
      }
    </style>
    <div id="outerRow" noSubLabel$="[[!hasSubLabel_(subLabel, subLabelHtml)]]">
      <cr-checkbox id="checkbox" checked="{{checked}}"
          on-change="notifyChangedByUserInteraction"
          disabled="[[controlDisabled(disabled, pref.*)]]"
          aria-label="[[label]]">
        <div id="label" class="label">[[label]] <slot></slot></div>
        <div id="subLabel" class="secondary label">
          <div inner-h-t-m-l="[[subLabelHtml]]"></div>
          [[subLabel]]
        </div>
      </cr-checkbox>
      <template is="dom-if" if="[[pref.controlledBy]]">
        <cr-policy-pref-indicator pref="[[pref]]" icon-aria-label="[[label]]">
        </cr-policy-pref-indicator>
      </template>
    </div>
  </template>
  <script src="settings_checkbox.js"></script>
</dom-module>