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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 for (var i = 0; i < overviewControls.length; ++i) { | 80 for (var i = 0; i < overviewControls.length; ++i) { |
81 overviewControls[i].setOverviewGrid(this._overviewGrid); | 81 overviewControls[i].setOverviewGrid(this._overviewGrid); |
82 overviewControls[i].show(this._overviewGrid.element); | 82 overviewControls[i].show(this._overviewGrid.element); |
83 } | 83 } |
84 this._overviewControls = overviewControls; | 84 this._overviewControls = overviewControls; |
85 this.update(); | 85 this.update(); |
86 }, | 86 }, |
87 | 87 |
88 update: function() | 88 update: function() |
89 { | 89 { |
90 delete this._refreshTimeout; | |
91 | |
92 if (this._model.isEmpty()) | 90 if (this._model.isEmpty()) |
93 this._overviewCalculator._setWindow(0, 1000); | 91 this._overviewCalculator._setWindow(0, 1000); |
94 else | 92 else |
95 this._overviewCalculator._setWindow(this._model.minimumRecordTime(),
this._model.maximumRecordTime()); | 93 this._overviewCalculator._setWindow(this._model.minimumRecordTime(),
this._model.maximumRecordTime()); |
96 | 94 |
97 this._overviewCalculator._setDisplayWindow(0, this._overviewGrid.clientW
idth()); | 95 this._overviewCalculator._setDisplayWindow(0, this._overviewGrid.clientW
idth()); |
98 for (var i = 0; i < this._overviewControls.length; ++i) | 96 for (var i = 0; i < this._overviewControls.length; ++i) |
99 this._overviewControls[i].update(); | 97 this._overviewControls[i].update(); |
100 this._overviewGrid.updateDividers(this._overviewCalculator); | 98 this._overviewGrid.updateDividers(this._overviewCalculator); |
101 this._updateEventDividers(); | 99 this._updateEventDividers(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 { | 164 { |
167 if (!this._overviewControls.length) | 165 if (!this._overviewControls.length) |
168 return; | 166 return; |
169 var windowBoundaries = this._overviewControls[0].windowBoundaries(this._
windowStartTime, this._windowEndTime); | 167 var windowBoundaries = this._overviewControls[0].windowBoundaries(this._
windowStartTime, this._windowEndTime); |
170 this._muteOnWindowChanged = true; | 168 this._muteOnWindowChanged = true; |
171 this._overviewGrid.setWindow(windowBoundaries.left, windowBoundaries.rig
ht); | 169 this._overviewGrid.setWindow(windowBoundaries.left, windowBoundaries.rig
ht); |
172 this._overviewGrid.setResizeEnabled(!!this._model.records().length); | 170 this._overviewGrid.setResizeEnabled(!!this._model.records().length); |
173 this._muteOnWindowChanged = false; | 171 this._muteOnWindowChanged = false; |
174 }, | 172 }, |
175 | 173 |
176 _scheduleRefresh: function() | |
177 { | |
178 if (this._refreshTimeout) | |
179 return; | |
180 if (!this.isShowing()) | |
181 return; | |
182 this._refreshTimeout = setTimeout(this.update.bind(this), 300); | |
183 }, | |
184 | |
185 __proto__: WebInspector.VBox.prototype | 174 __proto__: WebInspector.VBox.prototype |
186 } | 175 } |
187 | 176 |
188 /** | 177 /** |
189 * @constructor | 178 * @constructor |
190 * @implements {WebInspector.TimelineGrid.Calculator} | 179 * @implements {WebInspector.TimelineGrid.Calculator} |
191 */ | 180 */ |
192 WebInspector.TimelineOverviewCalculator = function() | 181 WebInspector.TimelineOverviewCalculator = function() |
193 { | 182 { |
194 } | 183 } |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 }, | 394 }, |
406 | 395 |
407 resetCanvas: function() | 396 resetCanvas: function() |
408 { | 397 { |
409 this._canvas.width = this.element.clientWidth * window.devicePixelRatio; | 398 this._canvas.width = this.element.clientWidth * window.devicePixelRatio; |
410 this._canvas.height = this.element.clientHeight * window.devicePixelRati
o; | 399 this._canvas.height = this.element.clientHeight * window.devicePixelRati
o; |
411 }, | 400 }, |
412 | 401 |
413 __proto__: WebInspector.VBox.prototype | 402 __proto__: WebInspector.VBox.prototype |
414 } | 403 } |
OLD | NEW |