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

Unified Diff: chrome/browser/resources/settings/people_page/sync_page.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/sync_page.js
diff --git a/chrome/browser/resources/settings/people_page/sync_page.js b/chrome/browser/resources/settings/people_page/sync_page.js
index 6fa8c3a6ef0f9f6f39805c24f6817c5debca23f4..0ef62fb65a4b27577a47e0f0ebe1a00b11cb040b 100644
--- a/chrome/browser/resources/settings/people_page/sync_page.js
+++ b/chrome/browser/resources/settings/people_page/sync_page.js
@@ -49,6 +49,7 @@ Polymer({
behaviors: [
I18nBehavior,
WebUIListenerBehavior,
+ settings.RouteObserverBehavior,
],
properties: {
@@ -69,14 +70,6 @@ Polymer({
},
/**
- * The current active route.
- */
- currentRoute: {
- type: Object,
- observer: 'currentRouteChanged_',
- },
-
- /**
* The current sync preferences, supplied by SyncBrowserProxy.
* @type {settings.SyncPrefs|undefined}
*/
@@ -131,22 +124,22 @@ Polymer({
this.addWebUIListener('sync-prefs-changed',
this.handleSyncPrefsChanged_.bind(this));
- if (this.currentRoute == settings.Route.SYNC)
+ if (settings.getCurrentRoute() == settings.Route.SYNC)
this.onNavigateToPage_();
},
/** @override */
detached: function() {
- if (this.currentRoute == settings.Route.SYNC)
+ if (settings.getCurrentRoute() == settings.Route.SYNC)
this.onNavigateAwayFromPage_();
},
- /** @private */
- currentRouteChanged_: function() {
+ /** @protected */
+ currentRouteChanged: function() {
if (!this.isAttached)
return;
- if (this.currentRoute == settings.Route.SYNC)
+ if (settings.getCurrentRoute() == settings.Route.SYNC)
this.onNavigateToPage_();
else
this.onNavigateAwayFromPage_();
@@ -156,7 +149,7 @@ Polymer({
onNavigateToPage_: function() {
// The element is not ready for C++ interaction until it is attached.
assert(this.isAttached);
- assert(this.currentRoute == settings.Route.SYNC);
+ assert(settings.getCurrentRoute() == settings.Route.SYNC);
if (this.unloadCallback_)
return;
@@ -301,7 +294,7 @@ Polymer({
this.selectedPage_ = pageStatus;
return;
case settings.PageStatus.DONE:
- if (this.currentRoute == settings.Route.SYNC)
+ if (settings.getCurrentRoute() == settings.Route.SYNC)
settings.navigateTo(settings.Route.PEOPLE);
return;
case settings.PageStatus.PASSPHRASE_FAILED:

Powered by Google App Engine
This is Rietveld 408576698