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

Side by Side Diff: chrome/browser/resources/md_history/history.js

Issue 1864023002: MD History: Add spinners when new data is loading or searching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 // Send the history query immediately. This allows the query to process during 5 // Send the history query immediately. This allows the query to process during
6 // the initial page startup. 6 // the initial page startup.
7 chrome.send('queryHistory', ['', 0, 0, 0, RESULTS_PER_PAGE]); 7 chrome.send('queryHistory', ['', 0, 0, 0, RESULTS_PER_PAGE]);
8 chrome.send('getForeignSessions'); 8 chrome.send('getForeignSessions');
9 9
10 /** 10 /**
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 var historyList = /** @type {HistoryListElement} */($('history-list')); 55 var historyList = /** @type {HistoryListElement} */($('history-list'));
56 var toolbar = /** @type {HistoryToolbarElement} */($('toolbar')); 56 var toolbar = /** @type {HistoryToolbarElement} */($('toolbar'));
57 var toBeRemoved = historyList.getSelectedItems(toolbar.count); 57 var toBeRemoved = historyList.getSelectedItems(toolbar.count);
58 chrome.send('removeVisits', toBeRemoved); 58 chrome.send('removeVisits', toBeRemoved);
59 }); 59 });
60 60
61 /** 61 /**
62 * When the search is changed refresh the results from the backend. 62 * When the search is changed refresh the results from the backend.
63 */ 63 */
64 window.addEventListener('search-changed', function(e) { 64 window.addEventListener('search-changed', function(e) {
65 /** @type {HistoryListElement} */($('history-list')).setLoading(); 65 /** @type {HistoryListElement} */($('history-list')).setSearching();
66 chrome.send('queryHistory', [e.detail.search, 0, 0, 0, RESULTS_PER_PAGE]); 66 chrome.send('queryHistory', [e.detail.search, 0, 0, 0, RESULTS_PER_PAGE]);
67 }); 67 });
68 68
69 /** 69 /**
70 * Switches between displaying history data and synced tabs data for the page. 70 * Switches between displaying history data and synced tabs data for the page.
71 */ 71 */
72 window.addEventListener('switch-display', function(e) { 72 window.addEventListener('switch-display', function(e) {
73 $('history-synced-device-manager').hidden = 73 $('history-synced-device-manager').hidden =
74 e.detail.display != 'synced-tabs-button'; 74 e.detail.display != 'synced-tabs-button';
75 $('history-list').hidden = e.detail.display != 'history-button'; 75 $('history-list').hidden = e.detail.display != 'history-button';
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 * Called by the history backend when the deletion failed. 131 * Called by the history backend when the deletion failed.
132 */ 132 */
133 function deleteFailed() { 133 function deleteFailed() {
134 } 134 }
135 135
136 /** 136 /**
137 * Called when the history is deleted by someone else. 137 * Called when the history is deleted by someone else.
138 */ 138 */
139 function historyDeleted() { 139 function historyDeleted() {
140 } 140 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698