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