| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 /** | 4 /** |
| 5 * @unrestricted | 5 * @unrestricted |
| 6 */ | 6 */ |
| 7 UI.ChartViewport = class extends UI.VBox { | 7 UI.ChartViewport = class extends UI.VBox { |
| 8 constructor() { | 8 constructor() { |
| 9 super(true); | 9 super(true); |
| 10 | 10 |
| 11 this.contentElement.addEventListener('mousewheel', this._onMouseWheel.bind(t
his), false); | 11 this.viewportElement = this.contentElement.createChild('div', 'fill'); |
| 12 this.contentElement.addEventListener('keydown', this._handleZoomPanKeys.bind
(this), false); | 12 this.viewportElement.addEventListener('mousewheel', this._onMouseWheel.bind(
this), false); |
| 13 this.viewportElement.addEventListener('keydown', this._handleZoomPanKeys.bin
d(this), false); |
| 13 | 14 |
| 14 this.viewportElement = this.contentElement.createChild('div', 'fill'); | |
| 15 UI.installInertialDragHandle( | 15 UI.installInertialDragHandle( |
| 16 this.viewportElement, this._startDragging.bind(this), this._dragging.bin
d(this), this._endDragging.bind(this), | 16 this.viewportElement, this._startDragging.bind(this), this._dragging.bin
d(this), this._endDragging.bind(this), |
| 17 '-webkit-grabbing', null); | 17 '-webkit-grabbing', null); |
| 18 UI.installDragHandle( | 18 UI.installDragHandle( |
| 19 this.viewportElement, this._startRangeSelection.bind(this), this._rangeS
electionDragging.bind(this), | 19 this.viewportElement, this._startRangeSelection.bind(this), this._rangeS
electionDragging.bind(this), |
| 20 this._endRangeSelection.bind(this), 'text', null); | 20 this._endRangeSelection.bind(this), 'text', null); |
| 21 | 21 |
| 22 this._vScrollElement = this.contentElement.createChild('div', 'flame-chart-v
-scroll'); | 22 this._vScrollElement = this.contentElement.createChild('div', 'flame-chart-v
-scroll'); |
| 23 this._vScrollContent = this._vScrollElement.createChild('div'); | 23 this._vScrollContent = this._vScrollElement.createChild('div'); |
| 24 this._vScrollElement.addEventListener('scroll', this._onScroll.bind(this), f
alse); | 24 this._vScrollElement.addEventListener('scroll', this._onScroll.bind(this), f
alse); |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 } | 430 } |
| 431 this._cancelAnimation(); | 431 this._cancelAnimation(); |
| 432 this._cancelWindowTimesAnimation = UI.animateFunction( | 432 this._cancelWindowTimesAnimation = UI.animateFunction( |
| 433 this.element.window(), this._animateWindowTimes.bind(this), | 433 this.element.window(), this._animateWindowTimes.bind(this), |
| 434 [{from: this._timeWindowLeft, to: startTime}, {from: this._timeWindowRig
ht, to: endTime}], 5, | 434 [{from: this._timeWindowLeft, to: startTime}, {from: this._timeWindowRig
ht, to: endTime}], 5, |
| 435 this._animationCompleted.bind(this)); | 435 this._animationCompleted.bind(this)); |
| 436 this._pendingAnimationTimeLeft = startTime; | 436 this._pendingAnimationTimeLeft = startTime; |
| 437 this._pendingAnimationTimeRight = endTime; | 437 this._pendingAnimationTimeRight = endTime; |
| 438 } | 438 } |
| 439 }; | 439 }; |
| OLD | NEW |