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

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

Issue 2154213008: Settings Router Refactor: Clean up Quick Unlock (and a few misc fixes) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0211-settings-router-impl-part-3-navigateTo
Patch Set: change test Created 4 years, 5 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 0222094a08d4881844881c8f53dca55aae9a6e7b..4f28913744913321a1042ba5a0dc0683db019894 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
@@ -51,12 +51,15 @@ var WEAK_PINS = [
Polymer({
is: 'settings-quick-unlock-setup-pin',
- behaviors: [
- QuickUnlockPasswordDetectBehavior,
- I18nBehavior
- ],
+ behaviors: [I18nBehavior, QuickUnlockPasswordDetectBehavior],
properties: {
+ /** @type {!settings.Route} */
+ currentRoute: {
+ type: Object,
+ observer: 'onRouteChanged_',
+ },
+
/**
* The current PIN keyboard value.
* @private
@@ -96,16 +99,13 @@ Polymer({
},
},
- observers: [
- 'onRouteChanged_(currentRoute)',
- 'onSetModesChanged_(setModes)'
- ],
+ observers: ['onSetModesChanged_(setModes)'],
/** @override */
attached: function() {
this.resetState_();
- if (this.isScreenActive(QuickUnlockScreen.SETUP_PIN))
+ if (this.currentRoute == settings.Route.QUICK_UNLOCK_SETUP_PIN)
this.askForPasswordIfUnset();
},
@@ -114,7 +114,7 @@ Polymer({
* @private
*/
onRouteChanged_: function(currentRoute) {
- if (this.isScreenActive(QuickUnlockScreen.SETUP_PIN)) {
+ if (this.currentRoute == settings.Route.QUICK_UNLOCK_SETUP_PIN) {
this.askForPasswordIfUnset();
} else {
// If the user hits the back button, they can leave the element
@@ -125,7 +125,7 @@ Polymer({
/** @private */
onSetModesChanged_: function() {
- if (this.isScreenActive(QuickUnlockScreen.SETUP_PIN))
+ if (this.currentRoute == settings.Route.QUICK_UNLOCK_SETUP_PIN)
this.askForPasswordIfUnset();
},

Powered by Google App Engine
This is Rietveld 408576698