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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after
1812 * @constructor 1812 * @constructor
1813 * @extends {WebInspector.TimelineOverviewBase} 1813 * @extends {WebInspector.TimelineOverviewBase}
1814 * @param {!WebInspector.TracingModel} tracingModel 1814 * @param {!WebInspector.TracingModel} tracingModel
1815 */ 1815 */
1816 WebInspector.TimelineFilmStripOverview = function(tracingModel) 1816 WebInspector.TimelineFilmStripOverview = function(tracingModel)
1817 { 1817 {
1818 WebInspector.TimelineOverviewBase.call(this); 1818 WebInspector.TimelineOverviewBase.call(this);
1819 this._tracingModel = tracingModel; 1819 this._tracingModel = tracingModel;
1820 this._filmStripView = new WebInspector.FilmStripView(); 1820 this._filmStripView = new WebInspector.FilmStripView();
1821 this._filmStripView.show(this.element); 1821 this._filmStripView.show(this.element);
1822 this._lastIndex = -1;
1823 this._lastElement = null;
1822 } 1824 }
1823 1825
1824 WebInspector.TimelineFilmStripOverview.prototype = { 1826 WebInspector.TimelineFilmStripOverview.prototype = {
1825 /** 1827 /**
1826 * @override 1828 * @override
1827 */ 1829 */
1828 update: function() 1830 update: function()
1829 { 1831 {
1830 var model = this._tracingModel; 1832 var model = this._tracingModel;
1831 this._filmStripModel = new WebInspector.FilmStripModel(model); 1833 this._filmStripModel = new WebInspector.FilmStripModel(model);
1832 this._filmStripView.setModel(this._filmStripModel, model.minimumRecordTi me(), model.maximumRecordTime() - model.minimumRecordTime()); 1834 this._filmStripView.setModel(this._filmStripModel, model.minimumRecordTi me(), model.maximumRecordTime() - model.minimumRecordTime());
1833 }, 1835 },
1834 1836
1835 /** 1837 /**
1836 * @override 1838 * @override
1839 * @param {number} time
1840 * @return {?Element}
1841 */
1842 popoverElement: function(time)
1843 {
1844 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.
1845 return null;
1846 var index = this._filmStripView.frameIndexByTime(time);
1847 console.assert(index >= 0);
1848 if (index !== this._lastIndex) {
1849 this._lastIndex = index;
1850 this._lastElement = this._filmStripView.frameElementByIndex(index);
1851 this._lastElement.appendChild(WebInspector.Widget.createStyleElement ("timeline/timelinePanel.css"));
1852 }
1853 return this._lastElement;
1854 },
1855
1856 /**
1857 * @override
1837 */ 1858 */
1838 reset: function() 1859 reset: function()
1839 { 1860 {
1840 this._filmStripView.reset(); 1861 this._filmStripView.reset();
1862 this._lastIndex = -1;
1863 this._lastElement = null;
1841 }, 1864 },
1842 1865
1843 __proto__: WebInspector.TimelineOverviewBase.prototype 1866 __proto__: WebInspector.TimelineOverviewBase.prototype
1844 } 1867 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698