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

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

Issue 2691943005: fix quick unlock config in options (Closed)
Patch Set: incorporate comments Created 3 years, 10 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/lock_screen.js
diff --git a/chrome/browser/resources/settings/people_page/lock_screen.js b/chrome/browser/resources/settings/people_page/lock_screen.js
index 70365d15396bd034b04fa7129ca3d02ffbfd210d..419671ac46b7f9b5432e6b1023c0b1cfb932051a 100644
--- a/chrome/browser/resources/settings/people_page/lock_screen.js
+++ b/chrome/browser/resources/settings/people_page/lock_screen.js
@@ -89,11 +89,8 @@ Polymer({
/** @override */
attached: function() {
- // currentRouteChanged is not called during the initial navigation. If the
- // user navigates directly to the lockScreen page, we still want to show the
- // password prompt page.
- this.currentRouteChanged(settings.Route.LOCK_SCREEN,
- settings.Route.LOCK_SCREEN);
+ if (this.shouldAskForPassword_(settings.getCurrentRoute()))
+ this.$.passwordPrompt.open();
this.browserProxy_ = settings.FingerprintBrowserProxyImpl.getInstance();
},
@@ -113,7 +110,7 @@ Polymer({
}.bind(this));
}
- if (newRoute == settings.Route.LOCK_SCREEN && !this.setModes_) {
+ if (this.shouldAskForPassword_(newRoute)) {
this.$.passwordPrompt.open();
} else if (newRoute != settings.Route.FINGERPRINT &&
oldRoute != settings.Route.FINGERPRINT) {
@@ -142,8 +139,7 @@ Polymer({
/** @private */
onSetModesChanged_: function() {
- if (settings.getCurrentRoute() == settings.Route.LOCK_SCREEN &&
- !this.setModes_) {
+ if (this.shouldAskForPassword_(settings.getCurrentRoute())) {
this.$.setupPin.close();
this.$.passwordPrompt.open();
}
@@ -201,4 +197,13 @@ Polymer({
onEditFingerprints_: function() {
settings.navigateTo(settings.Route.FINGERPRINT);
},
+
+ /**
+ * @param {!settings.Route} route
+ * @return {boolean} Whether the password dialog should be shown.
+ * @private
+ */
+ shouldAskForPassword_: function(route) {
+ return route == settings.Route.LOCK_SCREEN && !this.setModes_;
+ },
});
« no previous file with comments | « chrome/browser/resources/options_resources.grd ('k') | chrome/browser/ui/webui/options/browser_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698