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

Unified Diff: chrome/browser/resources/md_history/app.js

Issue 2068613002: [MD History] Add URL parameter for search. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@routing
Patch Set: Created 4 years, 6 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 | « chrome/browser/resources/md_history/app.html ('k') | chrome/browser/resources/md_history/side_bar.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_history/app.js
diff --git a/chrome/browser/resources/md_history/app.js b/chrome/browser/resources/md_history/app.js
index 9ad9f03ba38b828c75e935b8105c35e59ad23721..531d2c3bb92c7b77b4290817aab8ad64cf65a19b 100644
--- a/chrome/browser/resources/md_history/app.js
+++ b/chrome/browser/resources/md_history/app.js
@@ -64,7 +64,10 @@ Polymer({
'routeDataChanged_(routeData.page)',
'selectedPageChanged_(selectedPage_)',
+ // route.__queryParams.q <=> queryState.searchTerm
'searchTermChanged_(queryState_.searchTerm)',
+ 'searchQueryParamChanged_(route.__queryParams.q)',
tsergeant 2016/06/16 02:00:15 app-route exposes a `queryParams` property. You sh
calamity 2016/06/16 06:49:14 Ugh! So _that's_ where that was. I was so confused
+
'groupedRangeChanged_(queryState_.range)',
],
@@ -80,6 +83,10 @@ Polymer({
/** @override */
ready: function() {
this.grouped_ = loadTimeData.getBoolean('groupByDomain');
+ if (window.location.hash) {
+ window.location.href = window.location.href.split('#')[0] + '?' +
+ window.location.hash.substr(1);
+ }
},
/**
@@ -177,6 +184,11 @@ Polymer({
searchTermChanged_: function(searchTerm) {
this.queryHistory(false);
+ this.set('route.__queryParams.q', searchTerm || null);
+ },
+
+ searchQueryParamChanged_: function(searchTerm) {
+ this.$.toolbar.setSearchTerm(searchTerm || '');
},
groupedRangeChanged_: function(range) {
« no previous file with comments | « chrome/browser/resources/md_history/app.html ('k') | chrome/browser/resources/md_history/side_bar.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698