OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * 'settings-lock-screen' allows the user to change how they unlock their | 7 * 'settings-lock-screen' allows the user to change how they unlock their |
8 * device. | 8 * device. |
9 * | 9 * |
10 * Example: | 10 * Example: |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 this.$.setupPin.close(); | 201 this.$.setupPin.close(); |
202 this.$.passwordPrompt.open(); | 202 this.$.passwordPrompt.open(); |
203 } | 203 } |
204 }, | 204 }, |
205 | 205 |
206 /** @private */ | 206 /** @private */ |
207 onPasswordClosed_: function() { | 207 onPasswordClosed_: function() { |
208 if (!this.setModes_) | 208 if (!this.setModes_) |
209 settings.navigateTo(settings.Route.PEOPLE); | 209 settings.navigateTo(settings.Route.PEOPLE); |
210 else | 210 else |
211 this.$$('#unlockType').focus(); | 211 cr.ui.focusWithoutInk(assert(this.$$('#unlockType'))); |
212 }, | 212 }, |
213 | 213 |
214 /** @private */ | 214 /** @private */ |
215 onPinSetupDone_: function() { | 215 onPinSetupDone_: function() { |
216 this.$.setupPin.close(); | 216 this.$.setupPin.close(); |
217 }, | 217 }, |
218 | 218 |
219 /** @private */ | 219 /** @private */ |
220 onSetupPinClosed_: function() { | 220 onSetupPinClosed_: function() { |
221 this.$$('#setupPinButton').focus(); | 221 cr.ui.focusWithoutInk(assert(this.$$('#setupPinButton'))); |
222 }, | 222 }, |
223 | 223 |
224 /** | 224 /** |
225 * Returns true if the setup pin section should be shown. | 225 * Returns true if the setup pin section should be shown. |
226 * @param {!string} selectedUnlockType The current unlock type. Used to let | 226 * @param {!string} selectedUnlockType The current unlock type. Used to let |
227 * Polymer know about the dependency. | 227 * Polymer know about the dependency. |
228 * @private | 228 * @private |
229 */ | 229 */ |
230 showConfigurePinButton_: function(selectedUnlockType) { | 230 showConfigurePinButton_: function(selectedUnlockType) { |
231 return selectedUnlockType === LockScreenUnlockType.PIN_PASSWORD; | 231 return selectedUnlockType === LockScreenUnlockType.PIN_PASSWORD; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 e.preventDefault(); | 297 e.preventDefault(); |
298 this.showEasyUnlockTurnOffDialog_ = true; | 298 this.showEasyUnlockTurnOffDialog_ = true; |
299 }, | 299 }, |
300 | 300 |
301 /** @private */ | 301 /** @private */ |
302 onEasyUnlockTurnOffDialogClose_: function() { | 302 onEasyUnlockTurnOffDialogClose_: function() { |
303 this.showEasyUnlockTurnOffDialog_ = false; | 303 this.showEasyUnlockTurnOffDialog_ = false; |
304 | 304 |
305 // Restores focus on close to either the turn-off or set-up button, | 305 // Restores focus on close to either the turn-off or set-up button, |
306 // whichever is being displayed. | 306 // whichever is being displayed. |
307 this.$$('.secondary-button').focus(); | 307 cr.ui.focusWithoutInk(assert(this.$$('.secondary-button'))); |
308 }, | 308 }, |
309 | 309 |
310 /** | 310 /** |
311 * @param {boolean} enabled | 311 * @param {boolean} enabled |
312 * @param {!string} enabledStr | 312 * @param {!string} enabledStr |
313 * @param {!string} disabledStr | 313 * @param {!string} disabledStr |
314 * @private | 314 * @private |
315 */ | 315 */ |
316 getEasyUnlockDescription_: function(enabled, enabledStr, disabledStr) { | 316 getEasyUnlockDescription_: function(enabled, enabledStr, disabledStr) { |
317 return enabled ? enabledStr : disabledStr; | 317 return enabled ? enabledStr : disabledStr; |
318 }, | 318 }, |
319 | 319 |
320 /** | 320 /** |
321 * @param {boolean} easyUnlockEnabled | 321 * @param {boolean} easyUnlockEnabled |
322 * @param {boolean} proximityDetectionAllowed | 322 * @param {boolean} proximityDetectionAllowed |
323 * @private | 323 * @private |
324 */ | 324 */ |
325 getShowEasyUnlockToggle_: function( | 325 getShowEasyUnlockToggle_: function( |
326 easyUnlockEnabled, proximityDetectionAllowed) { | 326 easyUnlockEnabled, proximityDetectionAllowed) { |
327 return easyUnlockEnabled && proximityDetectionAllowed; | 327 return easyUnlockEnabled && proximityDetectionAllowed; |
328 }, | 328 }, |
329 }); | 329 }); |
OLD | NEW |