| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 if (newRoute == settings.Route.LOCK_SCREEN && | 169 if (newRoute == settings.Route.LOCK_SCREEN && |
| 170 this.fingerprintUnlockEnabled_ && this.fingerprintBrowserProxy_) { | 170 this.fingerprintUnlockEnabled_ && this.fingerprintBrowserProxy_) { |
| 171 this.fingerprintBrowserProxy_.getNumFingerprints().then( | 171 this.fingerprintBrowserProxy_.getNumFingerprints().then( |
| 172 function(numFingerprints) { | 172 function(numFingerprints) { |
| 173 this.numFingerprints_ = numFingerprints; | 173 this.numFingerprints_ = numFingerprints; |
| 174 }.bind(this)); | 174 }.bind(this)); |
| 175 } | 175 } |
| 176 | 176 |
| 177 if (this.shouldAskForPassword_(newRoute)) { | 177 if (this.shouldAskForPassword_(newRoute)) { |
| 178 this.openPasswordPromptDialog_(); | 178 this.openPasswordPromptDialog_(); |
| 179 } else if (newRoute != settings.Route.FINGERPRINT && | 179 } else if ( |
| 180 newRoute != settings.Route.FINGERPRINT && |
| 180 oldRoute != settings.Route.FINGERPRINT) { | 181 oldRoute != settings.Route.FINGERPRINT) { |
| 181 // If the user navigated away from the lock screen settings page they will | 182 // If the user navigated away from the lock screen settings page they will |
| 182 // have to re-enter their password. An exception is if they are navigating | 183 // have to re-enter their password. An exception is if they are navigating |
| 183 // to or from the fingerprint subpage. | 184 // to or from the fingerprint subpage. |
| 184 this.setModes_ = undefined; | 185 this.setModes_ = undefined; |
| 185 } | 186 } |
| 186 }, | 187 }, |
| 187 | 188 |
| 188 /** | 189 /** |
| 189 * Called when the unlock type has changed. | 190 * Called when the unlock type has changed. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 */ | 256 */ |
| 256 getSetupPinText_: function(hasPin) { | 257 getSetupPinText_: function(hasPin) { |
| 257 if (hasPin) | 258 if (hasPin) |
| 258 return this.i18n('lockScreenChangePinButton'); | 259 return this.i18n('lockScreenChangePinButton'); |
| 259 return this.i18n('lockScreenSetupPinButton'); | 260 return this.i18n('lockScreenSetupPinButton'); |
| 260 }, | 261 }, |
| 261 | 262 |
| 262 /** @private */ | 263 /** @private */ |
| 263 getDescriptionText_: function() { | 264 getDescriptionText_: function() { |
| 264 if (this.numFingerprints_ > 0) { | 265 if (this.numFingerprints_ > 0) { |
| 265 return this.i18n('lockScreenNumberFingerprints', | 266 return this.i18n( |
| 266 this.numFingerprints_.toString()); | 267 'lockScreenNumberFingerprints', this.numFingerprints_.toString()); |
| 267 } | 268 } |
| 268 | 269 |
| 269 return this.i18n('lockScreenEditFingerprintsDescription'); | 270 return this.i18n('lockScreenEditFingerprintsDescription'); |
| 270 }, | 271 }, |
| 271 | 272 |
| 272 /** @private */ | 273 /** @private */ |
| 273 onEditFingerprints_: function() { | 274 onEditFingerprints_: function() { |
| 274 settings.navigateTo(settings.Route.FINGERPRINT); | 275 settings.navigateTo(settings.Route.FINGERPRINT); |
| 275 }, | 276 }, |
| 276 | 277 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 /** | 332 /** |
| 332 * @param {boolean} easyUnlockEnabled | 333 * @param {boolean} easyUnlockEnabled |
| 333 * @param {boolean} proximityDetectionAllowed | 334 * @param {boolean} proximityDetectionAllowed |
| 334 * @private | 335 * @private |
| 335 */ | 336 */ |
| 336 getShowEasyUnlockToggle_: function( | 337 getShowEasyUnlockToggle_: function( |
| 337 easyUnlockEnabled, proximityDetectionAllowed) { | 338 easyUnlockEnabled, proximityDetectionAllowed) { |
| 338 return easyUnlockEnabled && proximityDetectionAllowed; | 339 return easyUnlockEnabled && proximityDetectionAllowed; |
| 339 }, | 340 }, |
| 340 }); | 341 }); |
| OLD | NEW |