Chromium Code Reviews| Index: Source/devtools/front_end/timeline/TimelinePanel.js |
| diff --git a/Source/devtools/front_end/timeline/TimelinePanel.js b/Source/devtools/front_end/timeline/TimelinePanel.js |
| index a1f08028b4ea4e4ad4c3205907dcc476e286df27..445a6fd2c3fde726738dc9a7f3023029e41a9ea4 100644 |
| --- a/Source/devtools/front_end/timeline/TimelinePanel.js |
| +++ b/Source/devtools/front_end/timeline/TimelinePanel.js |
| @@ -1819,6 +1819,8 @@ WebInspector.TimelineFilmStripOverview = function(tracingModel) |
| this._tracingModel = tracingModel; |
| this._filmStripView = new WebInspector.FilmStripView(); |
| this._filmStripView.show(this.element); |
| + this._lastIndex = -1; |
| + this._lastElement = null; |
| } |
| WebInspector.TimelineFilmStripOverview.prototype = { |
| @@ -1834,10 +1836,31 @@ WebInspector.TimelineFilmStripOverview.prototype = { |
| /** |
| * @override |
| + * @param {number} time |
| + * @return {?Element} |
| + */ |
| + popoverElement: function(time) |
| + { |
| + if (!this._filmStripModel.frames().length) |
|
caseq
2015/06/16 14:14:49
Is this guaranteed to always be called after updat
alph
2015/06/17 09:17:08
Guarded.
|
| + return null; |
| + var index = this._filmStripView.frameIndexByTime(time); |
| + console.assert(index >= 0); |
| + if (index !== this._lastIndex) { |
| + this._lastIndex = index; |
| + this._lastElement = this._filmStripView.frameElementByIndex(index); |
| + this._lastElement.appendChild(WebInspector.Widget.createStyleElement("timeline/timelinePanel.css")); |
| + } |
| + return this._lastElement; |
| + }, |
| + |
| + /** |
| + * @override |
| */ |
| reset: function() |
| { |
| this._filmStripView.reset(); |
| + this._lastIndex = -1; |
| + this._lastElement = null; |
| }, |
| __proto__: WebInspector.TimelineOverviewBase.prototype |