| 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
|
| */
|
|
|