Chromium Code Reviews| Index: chrome/browser/resources/history/history.js |
| diff --git a/chrome/browser/resources/history/history.js b/chrome/browser/resources/history/history.js |
| index 4b2292eb81e16743e8f8b977958c1751761fac10..5eb91c2fc96cb2053344e09d9be97d4d4b463cec 100644 |
| --- a/chrome/browser/resources/history/history.js |
| +++ b/chrome/browser/resources/history/history.js |
| @@ -36,16 +36,17 @@ MenuButton.createDropDownArrows(); |
| * @param {boolean} continued Whether this visit is on the same day as the |
| * visit before it. |
| * @param {HistoryModel} model The model object this entry belongs to. |
| - * @param {number} id The identifier for the entry. |
| * @constructor |
| */ |
| -function Visit(result, continued, model, id) { |
| +function Visit(result, continued, model) { |
| this.model_ = model; |
| this.title_ = result.title; |
| this.url_ = result.url; |
| this.starred_ = result.starred; |
| this.snippet_ = result.snippet || ''; |
| - this.id_ = id; |
| + // The id will be set according to when the visit was displayed, not |
| + // received. |
| + this.id_ = 0; |
|
Patrick Dubroy
2013/02/05 18:01:00
Should this maybe be -1? 0 is a valid id -- it wil
Sergiu
2013/02/05 20:16:27
It makes sense to set it to -1 to show that it has
|
| this.isRendered = false; // Has the visit already been rendered on the page? |
| @@ -103,6 +104,8 @@ Visit.prototype.getResultDOM = function(propertyBag) { |
| dropDown.setAttribute('menu', '#action-menu'); |
| cr.ui.decorate(dropDown, MenuButton); |
| + this.id_ = this.model_.nextVisitId_++; |
| + |
| // Checkbox is always created, but only visible on hover & when checked. |
| var checkbox = document.createElement('input'); |
| checkbox.type = 'checkbox'; |
| @@ -435,7 +438,7 @@ HistoryModel.prototype.addResults = function(info, results) { |
| visit.addDuplicateTimestamp(thisResult.timestamp); |
| continue; |
| } |
| - visit = new Visit(thisResult, isSameDay, this, this.nextVisitId_++); |
| + visit = new Visit(thisResult, isSameDay, this); |
| this.urlsFromLastSeenDay_[thisResult.url] = visit; |
| this.visits_.push(visit); |
| this.changed = true; |