Index: chrome/browser/resources/settings/route.js |
diff --git a/chrome/browser/resources/settings/route.js b/chrome/browser/resources/settings/route.js |
index 14b7de72effb567c3150fdb7dac16f11daaa46a9..c21d6812c75be6abb465c2d78cc72ede19b459d8 100644 |
--- a/chrome/browser/resources/settings/route.js |
+++ b/chrome/browser/resources/settings/route.js |
@@ -12,8 +12,8 @@ cr.define('settings', function() { |
var Route = function(url) { |
this.url = url; |
- /** @private {?settings.Route} */ |
- this.parent_ = null; |
+ /** @type {?settings.Route} */ |
+ this.parent = null; |
// Below are all legacy properties to provide compatibility with the old |
// routing system. TODO(tommycli): Remove once routing refactor complete. |
@@ -39,7 +39,7 @@ cr.define('settings', function() { |
var newUrl = path[0] == '/' ? path : this.url + '/' + path; |
var route = new Route(newUrl); |
- route.parent_ = this; |
+ route.parent = this; |
route.page = this.page; |
route.section = this.section; |
route.subpage = this.subpage.slice(); // Shallow copy. |
@@ -83,7 +83,7 @@ cr.define('settings', function() { |
* @return {boolean} |
*/ |
isDescendantOf: function(route) { |
- for (var parent = this.parent_; parent != null; parent = parent.parent_) { |
+ for (var parent = this.parent; parent != null; parent = parent.parent) { |
if (route == parent) |
return true; |
} |
@@ -140,7 +140,7 @@ cr.define('settings', function() { |
r.DEVICE = r.BASIC.createSection('/device', 'device'); |
r.POINTERS = r.DEVICE.createChild('/pointer-overlay', 'pointers'); |
- r.KEYBARD = r.DEVICE.createChild('/keyboard-overlay', 'keyboard'); |
+ r.KEYBOARD = r.DEVICE.createChild('/keyboard-overlay', 'keyboard'); |
r.DISPLAY = r.DEVICE.createChild('/display', 'display'); |
</if> |
@@ -266,7 +266,15 @@ cr.define('settings', function() { |
r.DETAILED_BUILD_INFO.section = 'about'; |
</if> |
+ /** |
+ * Use this function (and only this function) to navigate within Settings. |
+ * This function is set by settings-router once it is created. |
+ * @type {?function(!settings.Route):void} |
+ */ |
+ var navigateTo = null; |
Dan Beam
2016/07/21 00:05:42
how is this useful? why wouldn't this just live i
tommycli
2016/07/21 18:06:10
Goal is to delete in the future settings-router. T
|
+ |
return { |
Route: Route, |
+ navigateTo: navigateTo, |
}; |
}); |