Chromium Code Reviews| Index: chrome/browser/resources/settings/route.js |
| diff --git a/chrome/browser/resources/settings/route.js b/chrome/browser/resources/settings/route.js |
| index dc4f177aafd754a0af8b714d77e5cc4f30e603de..70b3570064f87252fd36fbd789b157c632940bd3 100644 |
| --- a/chrome/browser/resources/settings/route.js |
| +++ b/chrome/browser/resources/settings/route.js |
| @@ -296,7 +296,15 @@ cr.define('settings', function() { |
| * function settings.navigateTo. |
| * @private {!settings.Route} |
| */ |
| - var currentRoute_ = getRouteForPath(window.location.pathname) || Route.BASIC; |
| + var currentRoute_ = (function() { |
| + var route = getRouteForPath(window.location.pathname); |
| + if (route) |
| + return route; |
| + |
| + // Reset the URL path to '/' if the user navigates to a nonexistent URL. |
| + window.history.replaceState(undefined, '', Route.BASIC.path); |
|
michaelpg
2016/08/02 17:27:33
just a thought, maybe we should use ADVANCED (but
tommycli
2016/08/02 17:33:25
blah - that advanced toggle has always seemed lame
Dan Beam
2016/08/02 17:39:13
I think the goal is to have both Advanced toggles
|
| + return Route.BASIC; |
| + })(); |
| /** |
| * Helper function to set the current route and notify all observers. |
| @@ -320,7 +328,7 @@ cr.define('settings', function() { |
| if (assert(route) == currentRoute_) |
| return; |
| - window.history.pushState(undefined, document.title, route.path); |
| + window.history.pushState(undefined, '', route.path); |
| setCurrentRoute(route); |
| }; |