Chromium Code Reviews| 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.powerProfiler.isEnabled() && Capabiliti es.canProfilePower) | |
| 42 this.element.classList.add("power-overview"); | |
|
pfeldman
2014/03/24 13:41:25
You should not modify the overview, not even when
Pan
2014/03/25 12:30:20
removed.
| |
| 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); | |
|
pfeldman
2014/03/24 13:41:25
Overview control should not be concerned about the
Pan
2014/03/25 12:30:20
Done.
| |
| 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 startTimeline: function() { }, | |
|
pfeldman
2014/03/24 13:41:25
These should be called timelineStarted and timelin
Pan
2014/03/25 12:30:20
Done.
| |
| 324 stopTimeline: function() { }, | |
| 325 | |
| 326 windowChanged: function(timeLeft, timeRight) { }, | |
|
pfeldman
2014/03/24 13:41:25
Overview should not be concerned with the selected
Pan
2014/03/25 06:12:31
The intention is, I'd like to draw the energy cons
Pan
2014/03/25 12:30:20
Done.
| |
| 327 | |
| 318 /** | 328 /** |
| 319 * @param {number} windowLeft | 329 * @param {number} windowLeft |
| 320 * @param {number} windowRight | 330 * @param {number} windowRight |
| 321 * @return {!{startTime: number, endTime: number}} | 331 * @return {!{startTime: number, endTime: number}} |
| 322 */ | 332 */ |
| 323 windowTimes: function(windowLeft, windowRight) | 333 windowTimes: function(windowLeft, windowRight) |
| 324 { | 334 { |
| 325 var absoluteMin = this._model.minimumRecordTime(); | 335 var absoluteMin = this._model.minimumRecordTime(); |
| 326 var timeSpan = this._model.maximumRecordTime() - absoluteMin; | 336 var timeSpan = this._model.maximumRecordTime() - absoluteMin; |
| 327 return { | 337 return { |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 347 }, | 357 }, |
| 348 | 358 |
| 349 resetCanvas: function() | 359 resetCanvas: function() |
| 350 { | 360 { |
| 351 this._canvas.width = this.element.clientWidth * window.devicePixelRatio; | 361 this._canvas.width = this.element.clientWidth * window.devicePixelRatio; |
| 352 this._canvas.height = this.element.clientHeight * window.devicePixelRati o; | 362 this._canvas.height = this.element.clientHeight * window.devicePixelRati o; |
| 353 }, | 363 }, |
| 354 | 364 |
| 355 __proto__: WebInspector.View.prototype | 365 __proto__: WebInspector.View.prototype |
| 356 } | 366 } |
| OLD | NEW |