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

Unified Diff: chrome/browser/resources/settings/settings_main/settings_main.js

Issue 2184893002: Settings Router Refactor: Remove route.page legacy property. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0217-settings-refactor-settings-menu
Patch Set: 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_main/settings_main.js
diff --git a/chrome/browser/resources/settings/settings_main/settings_main.js b/chrome/browser/resources/settings/settings_main/settings_main.js
index 7150161af7458d9391d1995fa79bcc6cdbf432e2..6c1c303137d5a831574a2d56cab74fd785dc64f4 100644
--- a/chrome/browser/resources/settings/settings_main/settings_main.js
+++ b/chrome/browser/resources/settings/settings_main/settings_main.js
@@ -112,13 +112,14 @@ Polymer({
this.inSubpage_ = newRoute.subpage.length > 0;
this.style.height = this.inSubpage_ ? '100%' : '';
- if (newRoute.page == 'about') {
+ if (newRoute.inSubtreeOf(settings.Route.ABOUT)) {
michaelpg 2016/07/28 23:22:32 so, what we care about is what is the *root* of ne
tommycli 2016/07/29 00:03:35 So... I would create a 'root', except that we also
michaelpg 2016/07/29 00:21:12 in a later CL, you mean? Why do we want to get rid
michaelpg 2016/07/29 00:29:14 just realized I'm conflating .section and .subpage
tommycli 2016/07/29 18:23:43 Hey, I thought about the variety of things you sai
michaelpg 2016/07/29 20:28:53 "The contains(other) method must return true if ot
this.showPages_ = {about: true, basic: false, advanced: false};
} else {
this.showPages_ = {
about: false,
- basic: newRoute.page == 'basic' || !this.inSubpage_,
- advanced: newRoute.page == 'advanced' ||
+ basic:
+ newRoute.inSubtreeOf(settings.Route.BASIC) || !this.inSubpage_,
+ advanced: newRoute.inSubtreeOf(settings.Route.ADVANCED) ||
(!this.inSubpage_ && this.advancedToggleExpanded_),
};

Powered by Google App Engine
This is Rietveld 408576698