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

Unified Diff: chrome/browser/resources/settings/people_page/quick_unlock_setup_pin.js

Issue 2210933004: Settings Router Refactor: Kill settings-router. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix merge 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/people_page/quick_unlock_setup_pin.js
diff --git a/chrome/browser/resources/settings/people_page/quick_unlock_setup_pin.js b/chrome/browser/resources/settings/people_page/quick_unlock_setup_pin.js
index 4f28913744913321a1042ba5a0dc0683db019894..e74ab328963e6a92c1c697658335ac69ac4b7e1f 100644
--- a/chrome/browser/resources/settings/people_page/quick_unlock_setup_pin.js
+++ b/chrome/browser/resources/settings/people_page/quick_unlock_setup_pin.js
@@ -8,9 +8,7 @@
*
* Example:
*
- * <settings-quick-unlock-setup-pin
- * set-modes="[[quickUnlockSetModes]]"
- * current-route="{{currentRoute}}">
+ * <settings-quick-unlock-setup-pin set-modes="[[quickUnlockSetModes]]">
* </settings-quick-unlock-setup-pin>
*/
@@ -51,15 +49,13 @@ var WEAK_PINS = [
Polymer({
is: 'settings-quick-unlock-setup-pin',
- behaviors: [I18nBehavior, QuickUnlockPasswordDetectBehavior],
+ behaviors: [
+ I18nBehavior,
+ QuickUnlockPasswordDetectBehavior,
+ settings.RouteObserverBehavior
+ ],
properties: {
- /** @type {!settings.Route} */
- currentRoute: {
- type: Object,
- observer: 'onRouteChanged_',
- },
-
/**
* The current PIN keyboard value.
* @private
@@ -105,16 +101,13 @@ Polymer({
attached: function() {
this.resetState_();
- if (this.currentRoute == settings.Route.QUICK_UNLOCK_SETUP_PIN)
+ if (settings.getCurrentRoute() == settings.Route.QUICK_UNLOCK_SETUP_PIN)
this.askForPasswordIfUnset();
},
- /**
- * @param {!settings.Route} currentRoute
- * @private
- */
- onRouteChanged_: function(currentRoute) {
- if (this.currentRoute == settings.Route.QUICK_UNLOCK_SETUP_PIN) {
+ /** @protected */
+ currentRouteChanged: function() {
+ if (settings.getCurrentRoute() == settings.Route.QUICK_UNLOCK_SETUP_PIN) {
this.askForPasswordIfUnset();
} else {
// If the user hits the back button, they can leave the element
@@ -125,7 +118,7 @@ Polymer({
/** @private */
onSetModesChanged_: function() {
- if (this.currentRoute == settings.Route.QUICK_UNLOCK_SETUP_PIN)
+ if (settings.getCurrentRoute() == settings.Route.QUICK_UNLOCK_SETUP_PIN)
this.askForPasswordIfUnset();
},

Powered by Google App Engine
This is Rietveld 408576698