| 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:
|
|
|