Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Unified Diff: chrome/browser/resources/settings/route.js

Issue 2200013002: Settings Router Refactor: Improve chrome://md-settings/foobar behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert line change Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/cr_settings_browsertest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/cr_settings_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698