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 096b3c13c9ecc79ea540eec75d273a1504609128..091e4b745d3665aeda6803f9cc0a45a4bf9407d0 100644 |
| --- a/chrome/browser/resources/settings/route.js |
| +++ b/chrome/browser/resources/settings/route.js |
| @@ -312,16 +312,18 @@ cr.define('settings', function() { |
| */ |
| var currentQueryParameters_ = new URLSearchParams(); |
| - // Initialize the route and query params from the URL. |
| - (function() { |
| + /** |
| + * Initialize the route and query params from the URL. |
| + */ |
| + var initializeRouteFromUrl = function() { |
| var route = getRouteForPath(window.location.pathname); |
|
michaelpg
2016/08/12 22:18:02
wonder if it's worth adding a check that we only c
tommycli
2016/08/15 17:36:00
Done.
|
| if (route) { |
| currentRoute_ = route; |
| currentQueryParameters_ = new URLSearchParams(window.location.search); |
| } else { |
| - window.history.pushState(undefined, '', Route.BASIC.path); |
| + window.history.replaceState(undefined, '', Route.BASIC.path); |
| } |
| - })(); |
| + }; |
| /** |
| * Helper function to set the current route and notify all observers. |
| @@ -379,6 +381,7 @@ cr.define('settings', function() { |
| Route: Route, |
| RouteObserverBehavior: RouteObserverBehavior, |
| getRouteForPath: getRouteForPath, |
| + initializeRouteFromUrl: initializeRouteFromUrl, |
| getCurrentRoute: getCurrentRoute, |
| getQueryParameters: getQueryParameters, |
| navigateTo: navigateTo, |