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

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

Issue 2469393004: MD Settings: Preserve search URL param in subpages. (Closed)
Patch Set: Function params nit. Created 4 years, 1 month 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
Index: chrome/browser/resources/settings/settings_ui/settings_ui.js
diff --git a/chrome/browser/resources/settings/settings_ui/settings_ui.js b/chrome/browser/resources/settings/settings_ui/settings_ui.js
index c7f43de00a76617b7a52b16d7645b66af0afa1e2..b009c069e0f49e6f7fcaf3316fd5dabd0061faa5 100644
--- a/chrome/browser/resources/settings/settings_ui/settings_ui.js
+++ b/chrome/browser/resources/settings/settings_ui/settings_ui.js
@@ -122,18 +122,6 @@ Polymer({
/** @param {!settings.Route} route */
currentRouteChanged: function(route) {
- // New searches always take place on the BASIC route. Navigations into
- // subpages are either non-searches, or continuations of an existing search.
- //
- // TODO(dpapad): Address corner-case where the user:
- // 1) Visits a subpage first.
- // 2) Triggers a search.
- // 3) Clicks the "back" button.
- // Currently nothing happens. Should clear search results and navigate to
- // the subpage instead.
- if (route.isSubpage())
- return;
-
var urlSearchQuery = settings.getQueryParameters().get('search') || '';
if (urlSearchQuery == this.lastSearchQuery_)
return;
@@ -171,8 +159,8 @@ Polymer({
settings.navigateTo(
settings.Route.BASIC,
- query.length > 0 ?
- new URLSearchParams(`search=${query}`) : undefined);
+ query.length > 0 ? new URLSearchParams(`search=${query}`) : undefined,
+ /* removeSearch */ true);
},
/**
« no previous file with comments | « chrome/browser/resources/settings/settings_menu/settings_menu.js ('k') | chrome/test/data/webui/settings/route_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698