Index: chrome/browser/resources/settings/route.js |
diff --git a/chrome/browser/resources/settings/route.js b/chrome/browser/resources/settings/route.js |
index b5b14d42e63a969d25fafe70f49e01f21ae2cb1b..79be949e1c35618cf74f447cca1ae0850da790b8 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.TOUCHPAD = r.DEVICE.createChild('/pointer-overlay', 'touchpad'); |
- 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; |
+ |
return { |
Route: Route, |
+ navigateTo: navigateTo, |
}; |
}); |