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

Side by Side Diff: Source/devtools/front_end/TimelineOverviewPane.js

Issue 183893010: DevTools: extract TimelineModel.Record from TimelinePresentationModel.Record. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 if (dividers[dividerPosition]) 111 if (dividers[dividerPosition])
112 continue; 112 continue;
113 var divider = WebInspector.TimelineUIUtils.createEventDivider(record .type); 113 var divider = WebInspector.TimelineUIUtils.createEventDivider(record .type);
114 divider.style.left = positions.start + "%"; 114 divider.style.left = positions.start + "%";
115 dividers[dividerPosition] = divider; 115 dividers[dividerPosition] = divider;
116 } 116 }
117 this._overviewGrid.addEventDividers(dividers); 117 this._overviewGrid.addEventDividers(dividers);
118 }, 118 },
119 119
120 /** 120 /**
121 * @param {!TimelineAgent.TimelineEvent} record 121 * @param {!WebInspector.TimelineModel.Record} record
122 */ 122 */
123 addRecord: function(record) 123 addRecord: function(record)
124 { 124 {
125 var eventDividers = this._eventDividers; 125 var eventDividers = this._eventDividers;
126 function addEventDividers(record) 126 function addEventDividers(record)
127 { 127 {
128 if (WebInspector.TimelineUIUtils.isEventDivider(record)) 128 if (WebInspector.TimelineUIUtils.isEventDivider(record))
129 eventDividers.push(record); 129 eventDividers.push(record);
130 } 130 }
131 WebInspector.TimelinePresentationModel.forAllRecords([record], addEventD ividers); 131 WebInspector.TimelineModel.forAllRecords([record], addEventDividers);
132 this._scheduleRefresh(); 132 this._scheduleRefresh();
133 }, 133 },
134 134
135 _reset: function() 135 _reset: function()
136 { 136 {
137 this._overviewCalculator.reset(); 137 this._overviewCalculator.reset();
138 this._overviewGrid.reset(); 138 this._overviewGrid.reset();
139 this._overviewGrid.setResizeEnabled(false); 139 this._overviewGrid.setResizeEnabled(false);
140 this._eventDividers = []; 140 this._eventDividers = [];
141 this._overviewGrid.updateDividers(this._overviewCalculator); 141 this._overviewGrid.updateDividers(this._overviewCalculator);
(...skipping 19 matching lines...) Expand all
161 */ 161 */
162 requestWindowTimes: function(startTime, endTime) 162 requestWindowTimes: function(startTime, endTime)
163 { 163 {
164 if (startTime === this._windowStartTime && endTime === this._windowEndTi me) 164 if (startTime === this._windowStartTime && endTime === this._windowEndTi me)
165 return; 165 return;
166 this._windowStartTime = startTime; 166 this._windowStartTime = startTime;
167 this._windowEndTime = endTime; 167 this._windowEndTime = endTime;
168 var windowBoundaries = this._overviewControl.windowBoundaries(startTime, endTime); 168 var windowBoundaries = this._overviewControl.windowBoundaries(startTime, endTime);
169 this._muteOnWindowChanged = true; 169 this._muteOnWindowChanged = true;
170 this._overviewGrid.setWindow(windowBoundaries.left, windowBoundaries.rig ht); 170 this._overviewGrid.setWindow(windowBoundaries.left, windowBoundaries.rig ht);
171 this._overviewGrid.setResizeEnabled(this._model.records.length); 171 this._overviewGrid.setResizeEnabled(!!this._model.records().length);
172 this._muteOnWindowChanged = false; 172 this._muteOnWindowChanged = false;
173 173
174 this.dispatchEventToListeners(WebInspector.TimelineOverviewPane.Events.W indowChanged, { startTime: startTime, endTime: endTime }); 174 this.dispatchEventToListeners(WebInspector.TimelineOverviewPane.Events.W indowChanged, { startTime: startTime, endTime: endTime });
175 }, 175 },
176 176
177 _scheduleRefresh: function() 177 _scheduleRefresh: function()
178 { 178 {
179 if (this._refreshTimeout) 179 if (this._refreshTimeout)
180 return; 180 return;
181 if (!this.isShowing()) 181 if (!this.isShowing())
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 }, 340 },
341 341
342 resetCanvas: function() 342 resetCanvas: function()
343 { 343 {
344 this._canvas.width = this.element.clientWidth * window.devicePixelRatio; 344 this._canvas.width = this.element.clientWidth * window.devicePixelRatio;
345 this._canvas.height = this.element.clientHeight * window.devicePixelRati o; 345 this._canvas.height = this.element.clientHeight * window.devicePixelRati o;
346 }, 346 },
347 347
348 __proto__: WebInspector.View.prototype 348 __proto__: WebInspector.View.prototype
349 } 349 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698