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

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

Issue 339493006: Move divider detection and creation onto TimelineUIUtils instance (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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/TimelineOverviewPane.js
diff --git a/Source/devtools/front_end/timeline/TimelineOverviewPane.js b/Source/devtools/front_end/timeline/TimelineOverviewPane.js
index a44b13a53c08a08bcbb28280f16d2b6541847c90..80228c8816eb1c2ff08a31d3bf4600735a31dcb7 100644
--- a/Source/devtools/front_end/timeline/TimelineOverviewPane.js
+++ b/Source/devtools/front_end/timeline/TimelineOverviewPane.js
@@ -32,10 +32,12 @@
* @constructor
* @extends {WebInspector.VBox}
* @param {!WebInspector.TimelineModel} model
+ * @param {!WebInspector.TimelineUIUtils} uiUtils
*/
-WebInspector.TimelineOverviewPane = function(model)
+WebInspector.TimelineOverviewPane = function(model, uiUtils)
{
WebInspector.VBox.call(this);
+ this._uiUtils = uiUtils;
this.element.id = "timeline-overview-pane";
this._eventDividers = [];
@@ -110,7 +112,7 @@ WebInspector.TimelineOverviewPane.prototype = {
var dividerPosition = Math.round(positions.start * 10);
if (dividers[dividerPosition])
continue;
- var divider = WebInspector.TimelineUIUtils.createEventDivider(record.type());
+ var divider = this._uiUtils.createEventDivider(record.type());
divider.style.left = positions.start + "%";
dividers[dividerPosition] = divider;
}
@@ -123,9 +125,10 @@ WebInspector.TimelineOverviewPane.prototype = {
addRecord: function(record)
{
var eventDividers = this._eventDividers;
+ var uiUtils = this._uiUtils;
function addEventDividers(record)
{
- if (WebInspector.TimelineUIUtils.isEventDivider(record))
+ if (uiUtils.isEventDivider(record))
eventDividers.push(record);
}
WebInspector.TimelineModel.forAllRecords([record], addEventDividers);
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineModelImpl.js ('k') | Source/devtools/front_end/timeline/TimelinePanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698