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

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

Issue 1643693003: MD History: Implement search functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@patch_to_be_uploaded
Patch Set: Fix time-gap-separator insertion. Created 4 years, 10 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
Index: chrome/browser/resources/md_history/history.js
diff --git a/chrome/browser/resources/md_history/history.js b/chrome/browser/resources/md_history/history.js
index ae6da278a7d8760938ccae0a38caeff0f5b6d49e..bd35234e3ecc99675f895694fa720d8b46ae8db6 100644
--- a/chrome/browser/resources/md_history/history.js
+++ b/chrome/browser/resources/md_history/history.js
@@ -13,6 +13,7 @@
var BROWSING_GAP_TIME = 15 * 60 * 1000;
window.addEventListener('load', function() {
+ $('history-card-manager').loading = true;
chrome.send('queryHistory', ['', 0, 0, 0, RESULTS_PER_PAGE]);
});
@@ -67,6 +68,15 @@ window.addEventListener('resize', function() {
$('history-card-manager').closeMenu();
});
+/**
+ * When the search is changed refresh the results and load either search results
+ * or normal history results.
+ */
+window.addEventListener('refresh-results', function(e) {
+ $('history-card-manager').resetHistoryResults();
+ chrome.send('queryHistory', [e.detail.search, 0, 0, 0, RESULTS_PER_PAGE]);
+});
+
// Chrome Callbacks-------------------------------------------------------------
/**
@@ -75,7 +85,7 @@ window.addEventListener('resize', function() {
* @param {Array<HistoryEntry>} results A list of results.
*/
function historyResult(info, results) {
- $('history-card-manager').addNewResults(results);
+ $('history-card-manager').addNewResults(results, info.term);
}
/**

Powered by Google App Engine
This is Rietveld 408576698