OLD | NEW |
---|---|
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 20 matching lines...) Expand all Loading... | |
31 /** | 31 /** |
32 * @constructor | 32 * @constructor |
33 * @extends {WebInspector.View} | 33 * @extends {WebInspector.View} |
34 * @param {!WebInspector.TimelineModel} model | 34 * @param {!WebInspector.TimelineModel} model |
35 */ | 35 */ |
36 WebInspector.TimelineOverviewPane = function(model) | 36 WebInspector.TimelineOverviewPane = function(model) |
37 { | 37 { |
38 WebInspector.View.call(this); | 38 WebInspector.View.call(this); |
39 this.element.id = "timeline-overview-pane"; | 39 this.element.id = "timeline-overview-pane"; |
40 | 40 |
41 if (WebInspector.experimentsSettings.powerTimeline.isEnabled() && Capabiliti es.canProfilePower) | |
pfeldman
2014/03/11 12:24:02
You should not modify this either. I think it is b
| |
42 this.element.classList.add("power-overview"); | |
43 | |
41 this._eventDividers = []; | 44 this._eventDividers = []; |
42 | 45 |
43 this._model = model; | 46 this._model = model; |
44 | 47 |
45 this._overviewGrid = new WebInspector.OverviewGrid("timeline"); | 48 this._overviewGrid = new WebInspector.OverviewGrid("timeline"); |
46 this.element.appendChild(this._overviewGrid.element); | 49 this.element.appendChild(this._overviewGrid.element); |
47 | 50 |
48 this._overviewCalculator = new WebInspector.TimelineOverviewCalculator(); | 51 this._overviewCalculator = new WebInspector.TimelineOverviewCalculator(); |
49 | 52 |
50 model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleared, thi s._reset, this); | 53 model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleared, thi s._reset, this); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 this._update(); | 148 this._update(); |
146 }, | 149 }, |
147 | 150 |
148 /** | 151 /** |
149 * @param {!WebInspector.Event} event | 152 * @param {!WebInspector.Event} event |
150 */ | 153 */ |
151 _onWindowChanged: function(event) | 154 _onWindowChanged: function(event) |
152 { | 155 { |
153 if (this._muteOnWindowChanged) | 156 if (this._muteOnWindowChanged) |
154 return; | 157 return; |
158 | |
155 var windowTimes = this._overviewControl.windowTimes(this._overviewGrid.w indowLeft(), this._overviewGrid.windowRight()); | 159 var windowTimes = this._overviewControl.windowTimes(this._overviewGrid.w indowLeft(), this._overviewGrid.windowRight()); |
160 this._overviewControl.windowChanged(windowTimes.startTime, windowTimes.e ndTime); | |
156 this._windowStartTime = windowTimes.startTime; | 161 this._windowStartTime = windowTimes.startTime; |
157 this._windowEndTime = windowTimes.endTime; | 162 this._windowEndTime = windowTimes.endTime; |
158 this.dispatchEventToListeners(WebInspector.TimelineOverviewPane.Events.W indowChanged, windowTimes); | 163 this.dispatchEventToListeners(WebInspector.TimelineOverviewPane.Events.W indowChanged, windowTimes); |
159 }, | 164 }, |
160 | 165 |
161 /** | 166 /** |
162 * @param {number} startTime | 167 * @param {number} startTime |
163 * @param {number} endTime | 168 * @param {number} endTime |
164 */ | 169 */ |
165 requestWindowTimes: function(startTime, endTime) | 170 requestWindowTimes: function(startTime, endTime) |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
308 | 313 |
309 this._model = model; | 314 this._model = model; |
310 this._canvas = this.element.createChild("canvas", "fill"); | 315 this._canvas = this.element.createChild("canvas", "fill"); |
311 this._context = this._canvas.getContext("2d"); | 316 this._context = this._canvas.getContext("2d"); |
312 } | 317 } |
313 | 318 |
314 WebInspector.TimelineOverviewBase.prototype = { | 319 WebInspector.TimelineOverviewBase.prototype = { |
315 update: function() { }, | 320 update: function() { }, |
316 reset: function() { }, | 321 reset: function() { }, |
317 | 322 |
323 windowChanged: function(timeLeft, timeRight) { }, | |
324 | |
318 /** | 325 /** |
319 * @param {number} windowLeft | 326 * @param {number} windowLeft |
320 * @param {number} windowRight | 327 * @param {number} windowRight |
321 * @return {!{startTime: number, endTime: number}} | 328 * @return {!{startTime: number, endTime: number}} |
322 */ | 329 */ |
323 windowTimes: function(windowLeft, windowRight) | 330 windowTimes: function(windowLeft, windowRight) |
324 { | 331 { |
325 var absoluteMin = this._model.minimumRecordTime(); | 332 var absoluteMin = this._model.minimumRecordTime(); |
326 var timeSpan = this._model.maximumRecordTime() - absoluteMin; | 333 var timeSpan = this._model.maximumRecordTime() - absoluteMin; |
327 return { | 334 return { |
(...skipping 19 matching lines...) Expand all Loading... | |
347 }, | 354 }, |
348 | 355 |
349 resetCanvas: function() | 356 resetCanvas: function() |
350 { | 357 { |
351 this._canvas.width = this.element.clientWidth * window.devicePixelRatio; | 358 this._canvas.width = this.element.clientWidth * window.devicePixelRatio; |
352 this._canvas.height = this.element.clientHeight * window.devicePixelRati o; | 359 this._canvas.height = this.element.clientHeight * window.devicePixelRati o; |
353 }, | 360 }, |
354 | 361 |
355 __proto__: WebInspector.View.prototype | 362 __proto__: WebInspector.View.prototype |
356 } | 363 } |
OLD | NEW |