| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 }, | 76 }, |
| 77 | 77 |
| 78 /** selectedUnlockType is defined in LockStateBehavior. */ | 78 /** selectedUnlockType is defined in LockStateBehavior. */ |
| 79 observers: ['selectedUnlockTypeChanged_(selectedUnlockType)'], | 79 observers: ['selectedUnlockTypeChanged_(selectedUnlockType)'], |
| 80 | 80 |
| 81 /** @override */ | 81 /** @override */ |
| 82 attached: function() { | 82 attached: function() { |
| 83 // currentRouteChanged is not called during the initial navigation. If the | 83 // currentRouteChanged is not called during the initial navigation. If the |
| 84 // user navigates directly to the lockScreen page, we still want to show the | 84 // user navigates directly to the lockScreen page, we still want to show the |
| 85 // password prompt page. | 85 // password prompt page. |
| 86 this.currentRouteChanged(); | 86 this.currentRouteChanged(settings.Route.LOCK_SCREEN, |
| 87 settings.Route.LOCK_SCREEN); |
| 87 }, | 88 }, |
| 88 | 89 |
| 89 /** | 90 /** |
| 90 * Overridden from settings.RouteObserverBehavior. | 91 * Overridden from settings.RouteObserverBehavior. |
| 92 * @param {!settings.Route} newRoute |
| 93 * @param {!settings.Route} oldRoute |
| 91 * @protected | 94 * @protected |
| 92 */ | 95 */ |
| 93 currentRouteChanged: function() { | 96 currentRouteChanged: function(newRoute, oldRoute) { |
| 94 if (settings.getCurrentRoute() == settings.Route.LOCK_SCREEN && | 97 if (newRoute == settings.Route.LOCK_SCREEN && !this.setModes_) { |
| 95 !this.setModes_) { | |
| 96 this.$.passwordPrompt.open(); | 98 this.$.passwordPrompt.open(); |
| 97 } else { | 99 } else if (newRoute != settings.Route.FINGERPRINT && |
| 100 oldRoute != settings.Route.FINGERPRINT) { |
| 98 // If the user navigated away from the lock screen settings page they will | 101 // If the user navigated away from the lock screen settings page they will |
| 99 // have to re-enter their password. | 102 // have to re-enter their password. An exception is if they are navigating |
| 103 // to or from the fingerprint subpage. |
| 100 this.setModes_ = undefined; | 104 this.setModes_ = undefined; |
| 101 } | 105 } |
| 102 }, | 106 }, |
| 103 | 107 |
| 104 /** | 108 /** |
| 105 * Called when the unlock type has changed. | 109 * Called when the unlock type has changed. |
| 106 * @param {!string} selected The current unlock type. | 110 * @param {!string} selected The current unlock type. |
| 107 * @private | 111 * @private |
| 108 */ | 112 */ |
| 109 selectedUnlockTypeChanged_: function(selected) { | 113 selectedUnlockTypeChanged_: function(selected) { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 160 |
| 157 /** | 161 /** |
| 158 * @param {!Event} e | 162 * @param {!Event} e |
| 159 * @private | 163 * @private |
| 160 */ | 164 */ |
| 161 onConfigurePin_: function(e) { | 165 onConfigurePin_: function(e) { |
| 162 e.preventDefault(); | 166 e.preventDefault(); |
| 163 this.$.setupPin.open(); | 167 this.$.setupPin.open(); |
| 164 this.writeUma_(LockScreenProgress.CHOOSE_PIN_OR_PASSWORD); | 168 this.writeUma_(LockScreenProgress.CHOOSE_PIN_OR_PASSWORD); |
| 165 }, | 169 }, |
| 170 |
| 171 /** @private */ |
| 172 onEditFingerprints_: function() { |
| 173 settings.navigateTo(settings.Route.FINGERPRINT); |
| 174 }, |
| 166 }); | 175 }); |
| OLD | NEW |