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

Unified Diff: Source/devtools/front_end/timeline/TimelinePanel.js

Issue 1183483011: DevTools: Support popover on timeline overview. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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
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

Powered by Google App Engine
This is Rietveld 408576698