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

Unified Diff: chrome/browser/resources/settings/people_page/sync_page.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/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 c5fdc7d67fc27ed7a579ba249d16b52b1935221c..6fa8c3a6ef0f9f6f39805c24f6817c5debca23f4 100644
--- a/chrome/browser/resources/settings/people_page/sync_page.js
+++ b/chrome/browser/resources/settings/people_page/sync_page.js
@@ -131,33 +131,22 @@ Polymer({
this.addWebUIListener('sync-prefs-changed',
this.handleSyncPrefsChanged_.bind(this));
- if (this.isCurrentRouteOnSyncPage_())
+ if (this.currentRoute == settings.Route.SYNC)
this.onNavigateToPage_();
},
/** @override */
detached: function() {
- if (this.isCurrentRouteOnSyncPage_())
+ if (this.currentRoute == settings.Route.SYNC)
this.onNavigateAwayFromPage_();
},
- /**
- * @private
- * @return {boolean} Whether the current route shows the sync page.
- */
- isCurrentRouteOnSyncPage_: function() {
- return this.currentRoute &&
- this.currentRoute.section == 'people' &&
- this.currentRoute.subpage.length == 1 &&
- this.currentRoute.subpage[0] == 'sync';
- },
-
/** @private */
currentRouteChanged_: function() {
if (!this.isAttached)
return;
- if (this.isCurrentRouteOnSyncPage_())
+ if (this.currentRoute == settings.Route.SYNC)
this.onNavigateToPage_();
else
this.onNavigateAwayFromPage_();
@@ -167,7 +156,7 @@ Polymer({
onNavigateToPage_: function() {
// The element is not ready for C++ interaction until it is attached.
assert(this.isAttached);
- assert(this.isCurrentRouteOnSyncPage_());
+ assert(this.currentRoute == settings.Route.SYNC);
if (this.unloadCallback_)
return;
@@ -312,10 +301,8 @@ Polymer({
this.selectedPage_ = pageStatus;
return;
case settings.PageStatus.DONE:
- if (this.isCurrentRouteOnSyncPage_()) {
- // Event is caught by settings-animated-pages.
- this.fire('subpage-back');
- }
+ if (this.currentRoute == settings.Route.SYNC)
+ settings.navigateTo(settings.Route.PEOPLE);
return;
case settings.PageStatus.PASSPHRASE_FAILED:
if (this.selectedPage_ == this.pages.CONFIGURE &&
« no previous file with comments | « chrome/browser/resources/settings/people_page/sync_page.html ('k') | chrome/browser/resources/settings/settings_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698