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

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

Issue 2200233003: MD History: Refresh the list when clearing browsing data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test and vulcanize Created 4 years, 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 Polymer({ 5 Polymer({
6 is: 'history-list-container', 6 is: 'history-list-container',
7 7
8 properties: { 8 properties: {
9 // The path of the currently selected page. 9 // The path of the currently selected page.
10 selectedPage_: String, 10 selectedPage_: String,
(...skipping 26 matching lines...) Expand all
37 historyResult: function(info, results) { 37 historyResult: function(info, results) {
38 this.initializeResults_(info, results); 38 this.initializeResults_(info, results);
39 this.closeMenu_(); 39 this.closeMenu_();
40 40
41 if (this.selectedPage_ == 'grouped-list') { 41 if (this.selectedPage_ == 'grouped-list') {
42 this.$$('#grouped-list').historyData = results; 42 this.$$('#grouped-list').historyData = results;
43 return; 43 return;
44 } 44 }
45 45
46 var list = /** @type {HistoryListElement} */(this.$['infinite-list']); 46 var list = /** @type {HistoryListElement} */(this.$['infinite-list']);
47 list.addNewResults(results); 47 list.addNewResults(results, this.queryState.incremental,
48 this.getSelectedItemCount());
tsergeant 2016/08/17 06:58:28 For simplicity, I would suggest only checking the
lshang 2016/08/18 08:41:54 Done. Great idea!
48 if (info.finished) 49 if (info.finished)
49 list.disableResultLoading(); 50 list.disableResultLoading();
50 }, 51 },
51 52
52 /** 53 /**
53 * Queries the history backend for results based on queryState. 54 * Queries the history backend for results based on queryState.
54 * @param {boolean} incremental Whether the new query should continue where 55 * @param {boolean} incremental Whether the new query should continue where
55 * the previous query stopped. 56 * the previous query stopped.
56 */ 57 */
57 queryHistory: function(incremental) { 58 queryHistory: function(incremental) {
(...skipping 22 matching lines...) Expand all
80 } 81 }
81 82
82 var maxResults = 83 var maxResults =
83 queryState.range == HistoryRange.ALL_TIME ? RESULTS_PER_PAGE : 0; 84 queryState.range == HistoryRange.ALL_TIME ? RESULTS_PER_PAGE : 0;
84 chrome.send('queryHistory', [ 85 chrome.send('queryHistory', [
85 queryState.searchTerm, queryState.groupedOffset, queryState.range, 86 queryState.searchTerm, queryState.groupedOffset, queryState.range,
86 lastVisitTime, maxResults 87 lastVisitTime, maxResults
87 ]); 88 ]);
88 }, 89 },
89 90
91 clearingHistory: function() {
tsergeant 2016/08/17 06:58:28 For method names, use the plain verb form: clearH
lshang 2016/08/18 08:41:54 Done.
92 /** @type {HistoryListElement} */ (this.$['infinite-list'])
93 .clearingHistory();
94 },
95
90 /** @return {number} */ 96 /** @return {number} */
91 getSelectedItemCount: function() { 97 getSelectedItemCount: function() {
92 return this.getSelectedList_().selectedPaths.size; 98 return this.getSelectedList_().selectedPaths.size;
93 }, 99 },
94 100
95 unselectAllItems: function(count) { 101 unselectAllItems: function(count) {
96 this.getSelectedList_().unselectAllItems(count); 102 this.getSelectedList_().unselectAllItems(count);
97 }, 103 },
98 104
99 /** 105 /**
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 }, 213 },
208 214
209 /** 215 /**
210 * @return {HTMLElement} 216 * @return {HTMLElement}
211 * @private 217 * @private
212 */ 218 */
213 getSelectedList_: function() { 219 getSelectedList_: function() {
214 return this.$.content.selectedItem; 220 return this.$.content.selectedItem;
215 }, 221 },
216 }); 222 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698