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

Side by Side 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: Rebase and address reviewer comments. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Globals: 5 // Globals:
6 /** @const */ var RESULTS_PER_PAGE = 150; 6 /** @const */ var RESULTS_PER_PAGE = 150;
7 7
8 /** 8 /**
9 * Amount of time between pageviews that we consider a 'break' in browsing, 9 * Amount of time between pageviews that we consider a 'break' in browsing,
10 * measured in milliseconds. 10 * measured in milliseconds.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } 60 }
61 }); 61 });
62 62
63 /** 63 /**
64 * Resizing browser window will cause the overflow menu to close. 64 * Resizing browser window will cause the overflow menu to close.
65 */ 65 */
66 window.addEventListener('resize', function() { 66 window.addEventListener('resize', function() {
67 $('history-list').closeMenu(); 67 $('history-list').closeMenu();
68 }); 68 });
69 69
70 /**
71 * When the search is changed refresh the results and load either search results
72 * or normal history results.
73 */
74 window.addEventListener('refresh-results', function(e) {
75 $('history-list').resetHistoryResults();
76 chrome.send('queryHistory', [e.detail.search, 0, 0, 0, RESULTS_PER_PAGE]);
77 });
78
70 // Chrome Callbacks------------------------------------------------------------- 79 // Chrome Callbacks-------------------------------------------------------------
71 80
72 /** 81 /**
73 * Our history system calls this function with results from searches. 82 * Our history system calls this function with results from searches.
74 * @param {HistoryQuery} info An object containing information about the query. 83 * @param {HistoryQuery} info An object containing information about the query.
75 * @param {Array<HistoryEntry>} results A list of results. 84 * @param {Array<HistoryEntry>} results A list of results.
76 */ 85 */
77 function historyResult(info, results) { 86 function historyResult(info, results) {
78 $('history-list').addNewResults(results); 87 $('history-list').addNewResults(results, info.term);
79 } 88 }
80 89
81 /** 90 /**
82 * Called by the history backend when deletion was succesful. 91 * Called by the history backend when deletion was succesful.
83 */ 92 */
84 function deleteComplete() { 93 function deleteComplete() {
85 $('history-list').removeDeletedHistory($('toolbar').count); 94 $('history-list').removeDeletedHistory($('toolbar').count);
86 $('toolbar').count = 0; 95 $('toolbar').count = 0;
87 } 96 }
88 97
89 /** 98 /**
90 * Called by the history backend when the deletion failed. 99 * Called by the history backend when the deletion failed.
91 */ 100 */
92 function deleteFailed() { 101 function deleteFailed() {
93 } 102 }
94 103
95 /** 104 /**
96 * Called when the history is deleted by someone else. 105 * Called when the history is deleted by someone else.
97 */ 106 */
98 function historyDeleted() { 107 function historyDeleted() {
99 } 108 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_history/compiled_resources.gyp ('k') | chrome/browser/resources/md_history/history_item.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698