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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 { | 479 { |
480 if (this._muteAnimation || this._timeWindowLeft === 0 || this._timeWindo
wRight === Infinity || (startTime === 0 && endTime === Infinity)) { | 480 if (this._muteAnimation || this._timeWindowLeft === 0 || this._timeWindo
wRight === Infinity || (startTime === 0 && endTime === Infinity)) { |
481 // Initial setup. | 481 // Initial setup. |
482 this._timeWindowLeft = startTime; | 482 this._timeWindowLeft = startTime; |
483 this._timeWindowRight = endTime; | 483 this._timeWindowRight = endTime; |
484 this.scheduleUpdate(); | 484 this.scheduleUpdate(); |
485 return; | 485 return; |
486 } | 486 } |
487 | 487 |
488 this._cancelAnimation(); | 488 this._cancelAnimation(); |
489 this._cancelWindowTimesAnimation = WebInspector.animateFunction(this._an
imateWindowTimes.bind(this), | 489 this._cancelWindowTimesAnimation = WebInspector.animateFunction(this.ele
ment.window(), this._animateWindowTimes.bind(this), |
490 [{from: this._timeWindowLeft, to: startTime}, {from: this._timeWindo
wRight, to: endTime}], 5, | 490 [{from: this._timeWindowLeft, to: startTime}, {from: this._timeWindo
wRight, to: endTime}], 5, |
491 this._animationCompleted.bind(this)); | 491 this._animationCompleted.bind(this)); |
492 this._pendingAnimationTimeLeft = startTime; | 492 this._pendingAnimationTimeLeft = startTime; |
493 this._pendingAnimationTimeRight = endTime; | 493 this._pendingAnimationTimeRight = endTime; |
494 }, | 494 }, |
495 | 495 |
496 /** | 496 /** |
497 * @param {number} startTime | 497 * @param {number} startTime |
498 * @param {number} endTime | 498 * @param {number} endTime |
499 */ | 499 */ |
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1280 var showScroll = this._totalHeight > this._offsetHeight; | 1280 var showScroll = this._totalHeight > this._offsetHeight; |
1281 this._vScrollElement.classList.toggle("hidden", !showScroll); | 1281 this._vScrollElement.classList.toggle("hidden", !showScroll); |
1282 this._offsetWidth = this.contentElement.offsetWidth - (WebInspector.isMa
c() ? 0 : this._vScrollElement.offsetWidth); | 1282 this._offsetWidth = this.contentElement.offsetWidth - (WebInspector.isMa
c() ? 0 : this._vScrollElement.offsetWidth); |
1283 this._offsetHeight = this.contentElement.offsetHeight; | 1283 this._offsetHeight = this.contentElement.offsetHeight; |
1284 }, | 1284 }, |
1285 | 1285 |
1286 scheduleUpdate: function() | 1286 scheduleUpdate: function() |
1287 { | 1287 { |
1288 if (this._updateTimerId || this._cancelWindowTimesAnimation) | 1288 if (this._updateTimerId || this._cancelWindowTimesAnimation) |
1289 return; | 1289 return; |
1290 this._updateTimerId = requestAnimationFrame(this.update.bind(this)); | 1290 this._updateTimerId = this.element.window().requestAnimationFrame(this.u
pdate.bind(this)); |
1291 }, | 1291 }, |
1292 | 1292 |
1293 update: function() | 1293 update: function() |
1294 { | 1294 { |
1295 this._updateTimerId = 0; | 1295 this._updateTimerId = 0; |
1296 if (!this._timelineData()) | 1296 if (!this._timelineData()) |
1297 return; | 1297 return; |
1298 this._resetCanvas(); | 1298 this._resetCanvas(); |
1299 this._updateBoundaries(); | 1299 this._updateBoundaries(); |
1300 this._calculator._updateBoundaries(this); | 1300 this._calculator._updateBoundaries(this); |
1301 this._draw(this._offsetWidth, this._offsetHeight); | 1301 this._draw(this._offsetWidth, this._offsetHeight); |
1302 }, | 1302 }, |
1303 | 1303 |
1304 reset: function() | 1304 reset: function() |
1305 { | 1305 { |
1306 this._highlightedMarkerIndex = -1; | 1306 this._highlightedMarkerIndex = -1; |
1307 this._highlightedEntryIndex = -1; | 1307 this._highlightedEntryIndex = -1; |
1308 this._selectedEntryIndex = -1; | 1308 this._selectedEntryIndex = -1; |
1309 this._textWidth = {}; | 1309 this._textWidth = {}; |
1310 this.update(); | 1310 this.update(); |
1311 }, | 1311 }, |
1312 | 1312 |
1313 _enabled: function() | 1313 _enabled: function() |
1314 { | 1314 { |
1315 return this._rawTimelineDataLength !== 0; | 1315 return this._rawTimelineDataLength !== 0; |
1316 }, | 1316 }, |
1317 | 1317 |
1318 __proto__: WebInspector.HBox.prototype | 1318 __proto__: WebInspector.HBox.prototype |
1319 } | 1319 } |
OLD | NEW |