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

Unified Diff: chrome/browser/resources/settings/settings_page/settings_animated_pages.js

Issue 2156413002: Settings Router Refactor: Migrate to settings.Route.navigateTo calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use timing fix 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/settings_page/settings_animated_pages.js
diff --git a/chrome/browser/resources/settings/settings_page/settings_animated_pages.js b/chrome/browser/resources/settings/settings_page/settings_animated_pages.js
index c12168e0609909b5956094c168351b9d2a1fa1f2..34ce3f0c86c37dbb31b2af2096afae3a7f066960 100644
--- a/chrome/browser/resources/settings/settings_page/settings_animated_pages.js
+++ b/chrome/browser/resources/settings/settings_page/settings_animated_pages.js
@@ -46,10 +46,7 @@ Polymer({
this.lightDomChanged_.bind(this));
this.addEventListener('subpage-back', function() {
- assert(this.currentRoute.section == this.section);
- assert(this.currentRoute.subpage.length >= 1);
-
- this.setSubpageChain(this.currentRoute.subpage.slice(0, -1));
+ settings.navigateTo(this.currentRoute.parent);
}.bind(this));
},
@@ -141,24 +138,4 @@ Polymer({
template.if = true;
template.render();
},
-
- /**
- * Buttons in this pageset should use this method to transition to subpages.
- * @param {!Array<string>} subpage The chain of subpages within the page.
- */
- setSubpageChain: function(subpage) {
- var node = window.event.currentTarget;
- var page;
- while (node) {
- if (node.dataset && node.dataset.page)
- page = node.dataset.page;
- // A shadow root has a |host| rather than a |parentNode|.
- node = node.host || node.parentNode;
- }
- this.currentRoute = {
- page: page,
- section: subpage.length > 0 ? this.section : '',
- subpage: subpage,
- };
- },
});

Powered by Google App Engine
This is Rietveld 408576698