summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/settings/people_page/lock_screen.html
blob: 3b2ddbbe1fb97a0a75ff34a83137504d682be1bc (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
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<link rel="import" href="chrome://resources/html/polymer.html">

<link rel="import" href="chrome://resources/cr_elements/cr_radio_button/cr_radio_button.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_indicator.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-radio-group/paper-radio-group.html">
<link rel="import" href="../controls/settings_toggle_button.html">
<link rel="import" href="easy_unlock_browser_proxy.html">
<link rel="import" href="easy_unlock_turn_off_dialog.html">
<link rel="import" href="fingerprint_browser_proxy.html">
<link rel="import" href="lock_screen_constants.html">
<link rel="import" href="lock_state_behavior.html">
<link rel="import" href="password_prompt_dialog.html">
<link rel="import" href="setup_pin_dialog.html">
<link rel="import" href="../i18n_setup.html">
<link rel="import" href="../prefs/prefs_behavior.html">
<link rel="import" href="../prefs/prefs.html">
<link rel="import" href="../route.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="../settings_vars_css.html">

<dom-module id="settings-lock-screen">
  <template>
    <style include="settings-shared">
      cr-policy-indicator {
        -webkit-margin-start: auto;
        /* Align the indicator with the h2 that it is associated with. */
        padding-bottom: 12px;
        padding-top: 24px;
      }

      #easyUnlock .start {
        /* When the easy unlock toggle is shown, the easy unlock section's
         * content becomes squashed to the top and bottom edges. Use padding to
         * ensure the easy unlock content looks correct.
         */
        padding: 11px 0;
      }

      #lockOptionsDiv {
        display: block;
      }

      cr-radio-button {
        --cr-radio-button-label: {
          display: flex;
          line-height: 154%;  /* Apply 20px line-height to paper radio button
                                 text to match rest of settings line-heights. */
          width: 100%;
        };
      }

      #pinPasswordDiv,
      #pinPasswordSecondaryActionDiv {
        margin: auto;
      }

      #easyUnlockSettingsCollapsible {
        @apply --settings-list-frame-padding;
      }

      .no-padding {
        padding: 0;
      }

      .underbar {
        border-bottom: var(--settings-separator-line);
      }

      #unlockType[disabled] {
        opacity: var(--settings-disabled-opacity);
        pointer-events: none;
      }
    </style>

    <div>
      <settings-toggle-button id="enableLockScreen" class="first"
          pref="{{prefs.settings.enable_screen_lock}}"
          on-settings-boolean-control-change="onScreenLockChange_" no-set-pref
          label="$i18n{enableScreenlock}">
      </settings-toggle-button>

      <template is="dom-if" if="[[quickUnlockEnabled_]]">
        <div id="lockOptionsDiv">
          <div class="settings-box">
            <h2>[[selectLockScreenOptionsString(hasPinLogin)]]</h2>
            <template is="dom-if" if="[[quickUnlockDisabledByPolicy_]]">
              <cr-policy-indicator indicator-type="userPolicy">
              </cr-policy-indicator>
            </template>
          </div>
          <div class="list-frame" >
            <paper-radio-group id="unlockType"
                disabled$="[[quickUnlockDisabledByPolicy_]]"
                selected="{{selectedUnlockType}}" selectable="cr-radio-button">
              <cr-radio-button name="password" class="list-item underbar">
                <div class="start">
                  $i18n{lockScreenPasswordOnly}
                </div>
              </cr-radio-button>
              <cr-radio-button name="pin+password" class="list-item">
                <div id="pinPasswordDiv" class="start">
                  $i18n{lockScreenPinOrPassword}
                </div>
                <template is="dom-if"
                    if="[[showConfigurePinButton_(selectedUnlockType)]]">
                  <div class="separator"></div>
                  <div id="pinPasswordSecondaryActionDiv"
                      class="secondary-action">
                    <paper-button id="setupPinButton" class="secondary-button"
                        on-click="onConfigurePin_">
                      [[getSetupPinText_(hasPin)]]
                    </paper-button>
                  </div>
                </template>
              </cr-radio-button>
            </paper-radio-group>
          </div>
        </div>
      </template>

      <template is="dom-if" if="[[fingerprintUnlockEnabled_]]">
        <div id="fingerprintDiv">
          <settings-toggle-button class="continuation"
              pref="{{prefs.settings.enable_quick_unlock_fingerprint}}"
              label="$i18n{lockScreenFingerprintEnable}">
          </settings-toggle-button>
          <iron-collapse
              opened="[[prefs.settings.enable_quick_unlock_fingerprint.value]]">
            <div class="settings-box continuation">
              <div class="start">
                $i18n{lockScreenEditFingerprints}
                <div class="secondary" id="lockScreenEditFingerprintsSecondary">
                  [[getDescriptionText_(numFingerprints_)]]
                </div>
              </div>
              <div class="separator"></div>
              <div class="secondary-action">
                <paper-button class="secondary-button"
                    on-click="onEditFingerprints_"
                    aria-label="$i18n{lockScreenEditFingerprints}"
                    aria-descibedby="lockScreenEditFingerprintsSecondary">
                  $i18n{lockScreenSetupFingerprintButton}
                </paper-button>
              </div>
            </div>
          </iron-collapse>
        </div>
      </template>

      <template is="dom-if" if="[[easyUnlockAllowed_]]">
        <div id="easyUnlock" class="settings-box two-line">
          <div class="start">
            <div>$i18n{easyUnlockSectionTitle}</div>
            <div class="secondary">
              [[getEasyUnlockDescription_(easyUnlockEnabled_,
                  '$i18nPolymer{easyUnlockDescription}',
                  '$i18nPolymer{easyUnlockSetupIntro}')]]
              <a target="_blank" href="$i18n{easyUnlockLearnMoreURL}">
                $i18n{learnMore}
              </a>
            </div>
          </div>
          <div class="separator"></div>
          <template is="dom-if" if="[[!easyUnlockEnabled_]]">
            <paper-button id="easyUnlockSetup" class="secondary-button"
                on-click="onEasyUnlockSetupTap_">
              $i18n{easyUnlockSetupButton}
            </paper-button>
          </template>
          <template is="dom-if" if="[[easyUnlockEnabled_]]">
            <paper-button id="easyUnlockTurnOff" class="secondary-button"
                on-click="onEasyUnlockTurnOffTap_">
              $i18n{easyUnlockTurnOffButton}
            </paper-button>
          </template>
        </div>
        <iron-collapse opened="[[easyUnlockEnabled_]]"
            id="easyUnlockSettingsCollapsible">
          <settings-toggle-button
              class="continuation no-padding underbar"
              pref="{{prefs.proximity_auth.is_chromeos_login_enabled}}"
              label="$i18n{easyUnlockAllowSignInLabel}">
          </settings-toggle-button>
          <div class="settings-box continuation no-padding">
            <div class="start">
              $i18n{easyUnlockProximityThresholdLabel}
            </div>
            <settings-dropdown-menu
              pref="{{prefs.easy_unlock.proximity_threshold}}"
              menu-options="[[easyUnlockProximityThresholdMapping_]]">
            </settings-dropdown-menu>
          </div>
        </iron-collapse>
      </template>

      <template is="dom-if" if="[[showPasswordPromptDialog_]]" restamp>
        <settings-password-prompt-dialog id="passwordPrompt"
            on-close="onPasswordPromptDialogClose_" set-modes="{{setModes_}}"
            auth-token="{{authToken_}}">
        </settings-password-prompt-dialog>
      </template>

      <template is="dom-if" if="[[showSetupPinDialog_]]" restamp>
        <settings-setup-pin-dialog id="setupPin" set-modes="[[setModes_]]"
            on-close="onSetupPinDialogClose_">
        </settings-setup-pin-dialog>
      </template>

      <template is="dom-if" if="[[showEasyUnlockTurnOffDialog_]]" restamp>
        <easy-unlock-turn-off-dialog id="easyUnlockTurnOffDialog"
            on-close="onEasyUnlockTurnOffDialogClose_">
        </easy-unlock-turn-off-dialog>
      </template>
    </div>
  </template>

  <script src="lock_screen.js"></script>
</dom-module>