Chromium Code Reviews| Index: chrome/browser/resources/settings/people_page/quick_unlock_authenticate.js |
| diff --git a/chrome/browser/resources/settings/people_page/quick_unlock_authenticate.js b/chrome/browser/resources/settings/people_page/quick_unlock_authenticate.js |
| index b2bae7663f8fc8ab29797be91deedfaf344c2141..b288ffd89970e39894b06905a9501e81866263a1 100644 |
| --- a/chrome/browser/resources/settings/people_page/quick_unlock_authenticate.js |
| +++ b/chrome/browser/resources/settings/people_page/quick_unlock_authenticate.js |
| @@ -17,7 +17,6 @@ |
| * |
| * <settings-quick-unlock-authenticate |
| * set-modes="[[setModes]]" |
| - * current-route="{{currentRoute}}" |
| * profile-name="[[profileName_]]"> |
|
Dan Beam
2016/08/05 18:25:18
nit: example indent off ;)
tommycli
2016/08/05 18:54:05
Done.
|
| * </settings-quick-unlock-authenticate> |
| */ |
| @@ -46,13 +45,9 @@ function checkAccountPassword_(password, onCheck) { |
| Polymer({ |
| is: 'settings-quick-unlock-authenticate', |
| - properties: { |
| - /** @type {!settings.Route} */ |
| - currentRoute: { |
| - type: Object, |
| - observer: 'onRouteChanged_', |
| - }, |
| + behavior: [settings.RouteObserverBehavior], |
| + properties: { |
| /** |
| * A wrapper around chrome.quickUnlockPrivate.setModes with the account |
| * password already supplied. If this is null, the authentication screen |
| @@ -85,14 +80,15 @@ Polymer({ |
| passwordInvalid_: Boolean |
| }, |
| - /** @private */ |
| - onRouteChanged_: function(currentRoute) { |
| + /** @protected */ |
| + currentRouteChanged: function() { |
| // Clear local state if this screen is not active so if this screen shows |
| // up again the user will get a fresh UI. |
| - if (this.currentRoute != settings.Route.QUICK_UNLOCK_AUTHENTICATE) { |
| - this.password_ = ''; |
| - this.passwordInvalid_ = false; |
| - } |
| + if (settings.getCurrentRoute() == settings.Route.QUICK_UNLOCK_AUTHENTICATE) |
| + return; |
| + |
| + this.password_ = ''; |
| + this.passwordInvalid_ = false; |
| }, |
| /** |