| 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 95eebedea53c9fb49fa8e9114ad104cb19d200f9..8995d942fe9d021c5f91c0ef7e2411d2a7d9bc12 100644
|
| --- a/chrome/browser/resources/md_history/history_list.js
|
| +++ b/chrome/browser/resources/md_history/history_list.js
|
| @@ -86,6 +86,7 @@ Polymer({
|
| * @param {!Array<!HistoryEntry>} historyResults The new history results.
|
| */
|
| addNewResults: function(historyResults) {
|
| + var results = historyResults.slice();
|
| /** @type {IronScrollThresholdElement} */(this.$['scroll-threshold'])
|
| .clearTriggers();
|
|
|
| @@ -96,27 +97,6 @@ Polymer({
|
| this.lastSearchedTerm_ = this.searchedTerm;
|
| }
|
|
|
| - if (historyResults.length == 0)
|
| - return;
|
| -
|
| - // Creates a copy of historyResults to prevent accidentally modifying this
|
| - // field.
|
| - var results = historyResults.slice();
|
| -
|
| - var currentDate = results[0].dateRelativeDay;
|
| -
|
| - for (var i = 0; i < results.length; i++) {
|
| - // Sets the default values for these fields to prevent undefined types.
|
| - results[i].selected = false;
|
| - results[i].readableTimestamp =
|
| - this.searchedTerm == '' ?
|
| - results[i].dateTimeOfDay : results[i].dateShort;
|
| -
|
| - if (results[i].dateRelativeDay != currentDate) {
|
| - currentDate = results[i].dateRelativeDay;
|
| - }
|
| - }
|
| -
|
| if (this.historyData_) {
|
| // If we have previously received data, push the new items onto the
|
| // existing array.
|
| @@ -217,17 +197,8 @@ Polymer({
|
| * @private
|
| */
|
| needsTimeGap_: function(item, index, length) {
|
| - if (index >= length - 1 || length == 0)
|
| - return false;
|
| -
|
| - var currentItem = this.historyData_[index];
|
| - var nextItem = this.historyData_[index + 1];
|
| -
|
| - if (this.searchedTerm)
|
| - return currentItem.dateShort != nextItem.dateShort;
|
| -
|
| - return currentItem.time - nextItem.time > BROWSING_GAP_TIME &&
|
| - currentItem.dateRelativeDay == nextItem.dateRelativeDay;
|
| + return md_history.HistoryItem.needsTimeGap(
|
| + this.historyData_, index, this.searchedTerm);
|
| },
|
|
|
| hasResults: function(historyData_Length) {
|
|
|