| 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-quick-unlock-setup-pin' is the settings page for choosing a PIN. | 7 * 'settings-quick-unlock-setup-pin' is the settings page for choosing a PIN. |
| 8 * | 8 * |
| 9 * Example: | 9 * Example: |
| 10 * | 10 * |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 'onSetModesChanged_(setModes)' | 101 'onSetModesChanged_(setModes)' |
| 102 ], | 102 ], |
| 103 | 103 |
| 104 /** @override */ | 104 /** @override */ |
| 105 attached: function() { | 105 attached: function() { |
| 106 this.resetState_(); | 106 this.resetState_(); |
| 107 this.askForPasswordIfUnset(); | 107 this.askForPasswordIfUnset(); |
| 108 }, | 108 }, |
| 109 | 109 |
| 110 /** | 110 /** |
| 111 * @param {!SettingsRoute} currentRoute | 111 * @param {!settings.Route} currentRoute |
| 112 * @private | 112 * @private |
| 113 */ | 113 */ |
| 114 onRouteChanged_: function(currentRoute) { | 114 onRouteChanged_: function(currentRoute) { |
| 115 if (this.isScreenActive(QuickUnlockScreen.SETUP_PIN)) { | 115 if (this.isScreenActive(QuickUnlockScreen.SETUP_PIN)) { |
| 116 this.askForPasswordIfUnset(); | 116 this.askForPasswordIfUnset(); |
| 117 } else { | 117 } else { |
| 118 // If the user hits the back button, they can leave the element | 118 // If the user hits the back button, they can leave the element |
| 119 // half-completed; therefore, reset state if the element is not active. | 119 // half-completed; therefore, reset state if the element is not active. |
| 120 this.resetState_(); | 120 this.resetState_(); |
| 121 } | 121 } |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 if (!this.canSubmit_()) | 243 if (!this.canSubmit_()) |
| 244 return; | 244 return; |
| 245 | 245 |
| 246 function onSetModesCompleted(didSet) { | 246 function onSetModesCompleted(didSet) { |
| 247 if (!didSet) { | 247 if (!didSet) { |
| 248 console.error('Failed to update pin'); | 248 console.error('Failed to update pin'); |
| 249 return; | 249 return; |
| 250 } | 250 } |
| 251 | 251 |
| 252 this.resetState_(); | 252 this.resetState_(); |
| 253 this.currentRoute = { | 253 settings.navigateTo(settings.Route.QUICK_UNLOCK_CHOOSE_METHOD); |
| 254 page: 'basic', | |
| 255 section: 'people', | |
| 256 subpage: [QuickUnlockScreen.CHOOSE_METHOD] | |
| 257 }; | |
| 258 } | 254 } |
| 259 | 255 |
| 260 this.setModes.call( | 256 this.setModes.call( |
| 261 null, | 257 null, |
| 262 [chrome.quickUnlockPrivate.QuickUnlockMode.PIN], | 258 [chrome.quickUnlockPrivate.QuickUnlockMode.PIN], |
| 263 [this.pinKeyboardValue_], | 259 [this.pinKeyboardValue_], |
| 264 onSetModesCompleted.bind(this)); | 260 onSetModesCompleted.bind(this)); |
| 265 } | 261 } |
| 266 }, | 262 }, |
| 267 | 263 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 291 * @return {string} | 287 * @return {string} |
| 292 */ | 288 */ |
| 293 getContinueMessage_: function(isConfirmStep) { | 289 getContinueMessage_: function(isConfirmStep) { |
| 294 if (!isConfirmStep) | 290 if (!isConfirmStep) |
| 295 return this.i18n('quickUnlockConfigurePinContinueButton'); | 291 return this.i18n('quickUnlockConfigurePinContinueButton'); |
| 296 return this.i18n('save'); | 292 return this.i18n('save'); |
| 297 }, | 293 }, |
| 298 }); | 294 }); |
| 299 | 295 |
| 300 })(); | 296 })(); |
| OLD | NEW |