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

Unified Diff: chrome/browser/resources/md_history/app.crisper.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: revise test 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
« no previous file with comments | « chrome/browser/resources/md_history/app.js ('k') | chrome/browser/resources/md_history/history.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_history/app.crisper.js
diff --git a/chrome/browser/resources/md_history/app.crisper.js b/chrome/browser/resources/md_history/app.crisper.js
index 3e75862e14094e32974a703a7d4959977c019372..dcdc7af019434502ee18ddbde21d6d44aeec1a36 100644
--- a/chrome/browser/resources/md_history/app.crisper.js
+++ b/chrome/browser/resources/md_history/app.crisper.js
@@ -14080,8 +14080,6 @@ Polymer({
value: '',
},
- lastSearchedTerm_: String,
-
querying: Boolean,
// An array of history entries in reverse chronological order.
@@ -14136,18 +14134,19 @@ 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.
*/
- addNewResults: function(historyResults) {
+ addNewResults: function(historyResults, incremental) {
var results = historyResults.slice();
/** @type {IronScrollThresholdElement} */(this.$['scroll-threshold'])
.clearTriggers();
- if (this.lastSearchedTerm_ != this.searchedTerm) {
+ if (!incremental) {
this.resultLoadingDisabled_ = false;
if (this.historyData_)
this.splice('historyData_', 0, this.historyData_.length);
this.fire('unselect-all');
- this.lastSearchedTerm_ = this.searchedTerm;
}
if (this.historyData_) {
@@ -14385,7 +14384,7 @@ Polymer({
}
var list = /** @type {HistoryListElement} */(this.$['infinite-list']);
- list.addNewResults(results);
+ list.addNewResults(results, this.queryState.incremental);
if (info.finished)
list.disableResultLoading();
},
@@ -14428,6 +14427,15 @@ Polymer({
]);
},
+ historyDeleted: function() {
+ // Do not reload the list when there are items checked.
+ if (this.getSelectedItemCount() > 0)
+ return;
+
+ // Reload the list with current search state.
+ this.queryHistory(false);
+ },
+
/** @return {number} */
getSelectedItemCount: function() {
return this.getSelectedList_().selectedPaths.size;
@@ -15247,6 +15255,13 @@ Polymer({
},
/**
+ * Called when browsing data is cleared.
+ */
+ historyDeleted: function() {
+ this.$.history.historyDeleted();
+ },
+
+ /**
* Update sign in state of synced device manager after user logs in or out.
* @param {boolean} isUserSignedIn
*/
« no previous file with comments | « chrome/browser/resources/md_history/app.js ('k') | chrome/browser/resources/md_history/history.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698