Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Side by Side Diff: chrome/browser/resources/settings/people_page/quick_unlock_setup_pin.js

Issue 2156413002: Settings Router Refactor: Migrate to settings.Route.navigateTo calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use timing fix Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698