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

Unified Diff: chrome/browser/resources/md_history/history_list.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/md_history/history_list.js
diff --git a/chrome/browser/resources/md_history/history_list.js b/chrome/browser/resources/md_history/history_list.js
index 11b59112e52d82afcd77d6f342b1d7140d652865..ca84834584515dd1a6f345e84ca4d4099814bc30 100644
--- a/chrome/browser/resources/md_history/history_list.js
+++ b/chrome/browser/resources/md_history/history_list.js
@@ -18,6 +18,11 @@ Polymer({
querying: Boolean,
+ clearingHistory_: {
+ type: Boolean,
+ value: false,
+ },
+
// An array of history entries in reverse chronological order.
historyData_: Array,
@@ -70,13 +75,24 @@ Polymer({
* Adds the newly updated history results into historyData_. Adds new fields
* for each result.
* @param {!Array<!HistoryEntry>} historyResults The new history results.
+ * @param {boolean} incremental Whether the result is from loading more
+ * history, or a new search/list reload.
+ * @param {number} selectedCount Number of selected items.
*/
- addNewResults: function(historyResults) {
+ addNewResults: function(historyResults, incremental, selectedCount) {
var results = historyResults.slice();
/** @type {IronScrollThresholdElement} */(this.$['scroll-threshold'])
.clearTriggers();
- if (this.lastSearchedTerm_ != this.searchedTerm) {
+ // Do not reload the list when clearing browsing data and there are items
+ // checked.
+ if (this.clearingHistory_) {
+ this.clearingHistory_ = false;
+ if (selectedCount > 0)
+ return;
+ }
+
+ if (!incremental) {
this.resultLoadingDisabled_ = false;
if (this.historyData_)
this.splice('historyData_', 0, this.historyData_.length);
@@ -96,6 +112,10 @@ Polymer({
}
},
+ clearingHistory: function() {
+ this.clearingHistory_ = true;
+ },
+
/**
* Called when the page is scrolled to near the bottom of the list.
* @private

Powered by Google App Engine
This is Rietveld 408576698