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

Unified Diff: chrome/browser/resources/settings/route.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/route.js
diff --git a/chrome/browser/resources/settings/route.js b/chrome/browser/resources/settings/route.js
index f1c092c41f7f65a0731888d4f9052e401701f3b2..c3a73c0a63491c1b03d935db8dc49e7db4e38b8b 100644
--- a/chrome/browser/resources/settings/route.js
+++ b/chrome/browser/resources/settings/route.js
@@ -17,7 +17,6 @@ cr.define('settings', function() {
// Below are all legacy properties to provide compatibility with the old
// routing system. TODO(tommycli): Remove once routing refactor complete.
- this.page = '';
this.section = '';
/** @type {!Array<string>} */ this.subpage = [];
};
@@ -40,7 +39,6 @@ cr.define('settings', function() {
var route = new Route(newUrl);
route.parent = this;
- route.page = this.page;
route.section = this.section;
route.subpage = this.subpage.slice(); // Shallow copy.
@@ -78,11 +76,14 @@ cr.define('settings', function() {
},
/**
- * Returns true if this route is a descendant of the parameter.
+ * Returns true if this route matches or is a descendant of the parameter.
* @param {!settings.Route} route
* @return {boolean}
*/
- isDescendantOf: function(route) {
+ inSubtreeOf: function(route) {
michaelpg 2016/07/28 23:22:32 bikeshedding: kind of a confusing name and concept
tommycli 2016/07/29 00:03:35 It's a confusing name. I changed it to isEqualOrIn
michaelpg 2016/07/29 00:21:11 Like, that's my point: every use in this CL could
+ if (this == route)
+ return true;
+
for (var parent = this.parent; parent != null; parent = parent.parent) {
if (route == parent)
return true;
@@ -97,11 +98,8 @@ cr.define('settings', function() {
// Root pages.
r.BASIC = new Route('/');
- r.BASIC.page = 'basic';
r.ADVANCED = new Route('/advanced');
- r.ADVANCED.page = 'advanced';
r.ABOUT = new Route('/help');
- r.ABOUT.page = 'about';
<if expr="chromeos">
r.INTERNET = r.BASIC.createSection('/internet', 'internet');

Powered by Google App Engine
This is Rietveld 408576698