Index: chrome/browser/resources/settings/route.js |
diff --git a/chrome/browser/resources/settings/route.js b/chrome/browser/resources/settings/route.js |
index 09644846cbb7c01a48d8082cabb19fdb677d6d67..c9e186b6d06916663ce61ff26e2147fe53a8d387 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'); |
Dan Beam
2016/07/23 00:17:11
KEYBARRRRRD!
tommycli
2016/07/25 16:47:20
Acknowledged.
|
+ r.KEYBOARD = r.DEVICE.createChild('/keyboard-overlay', 'keyboard'); |
r.DISPLAY = r.DEVICE.createChild('/display', 'display'); |
</if> |
@@ -262,7 +262,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; |
+ |
return { |
Route: Route, |
+ navigateTo: navigateTo, |
}; |
}); |