| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 */ | 7 */ |
| 8 WebInspector.AnimationControlPane = function() | 8 WebInspector.AnimationControlPane = function() |
| 9 { | 9 { |
| 10 this._animationsPaused = false; | 10 this._animationsPaused = false; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 } | 32 } |
| 33 | 33 |
| 34 WebInspector.AnimationControlPane.prototype = { | 34 WebInspector.AnimationControlPane.prototype = { |
| 35 | 35 |
| 36 /** | 36 /** |
| 37 * @param {!Event} event | 37 * @param {!Event} event |
| 38 */ | 38 */ |
| 39 _playbackSliderInputHandler: function (event) | 39 _playbackSliderInputHandler: function (event) |
| 40 { | 40 { |
| 41 this._animationsPlaybackRate = WebInspector.AnimationsSidebarPane.Global
PlaybackRates[event.target.value]; | 41 this._animationsPlaybackRate = WebInspector.AnimationsSidebarPane.Global
PlaybackRates[event.target.value]; |
| 42 this._target.animationAgent().setPlaybackRate(this._animationsPaused ? 0
: this._animationsPlaybackRate); | 42 this._target.animationModel.setPlaybackRate(this._animationsPaused ? 0 :
this._animationsPlaybackRate); |
| 43 this._animationsPlaybackLabel.textContent = this._animationsPlaybackRate
+ "x"; | 43 this._animationsPlaybackLabel.textContent = this._animationsPlaybackRate
+ "x"; |
| 44 WebInspector.userMetrics.AnimationsPlaybackRateChanged.record(); | 44 WebInspector.userMetrics.AnimationsPlaybackRateChanged.record(); |
| 45 }, | 45 }, |
| 46 | 46 |
| 47 _pauseButtonHandler: function () | 47 _pauseButtonHandler: function () |
| 48 { | 48 { |
| 49 this._animationsPaused = !this._animationsPaused; | 49 this._animationsPaused = !this._animationsPaused; |
| 50 this._target.animationAgent().setPlaybackRate(this._animationsPaused ? 0
: this._animationsPlaybackRate); | 50 this._target.animationModel.setPlaybackRate(this._animationsPaused ? 0 :
this._animationsPlaybackRate); |
| 51 WebInspector.userMetrics.AnimationsPlaybackRateChanged.record(); | 51 WebInspector.userMetrics.AnimationsPlaybackRateChanged.record(); |
| 52 this._animationsPauseButton.element.classList.toggle("pause-toolbar-item
"); | 52 this._animationsPauseButton.element.classList.toggle("pause-toolbar-item
"); |
| 53 this._animationsPauseButton.element.classList.toggle("play-toolbar-item"
); | 53 this._animationsPauseButton.element.classList.toggle("play-toolbar-item"
); |
| 54 }, | 54 }, |
| 55 | 55 |
| 56 /** | 56 /** |
| 57 * @param {!WebInspector.Event=} event | 57 * @param {!WebInspector.Event=} event |
| 58 */ | 58 */ |
| 59 _updateAnimationsPlaybackRate: function(event) | 59 _updateAnimationsPlaybackRate: function(event) |
| 60 { | 60 { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 83 | 83 |
| 84 if (this._target) | 84 if (this._target) |
| 85 this._target.resourceTreeModel.removeEventListener(WebInspector.Reso
urceTreeModel.EventTypes.MainFrameNavigated, this._updateAnimationsPlaybackRate,
this); | 85 this._target.resourceTreeModel.removeEventListener(WebInspector.Reso
urceTreeModel.EventTypes.MainFrameNavigated, this._updateAnimationsPlaybackRate,
this); |
| 86 | 86 |
| 87 this._target = node.target(); | 87 this._target = node.target(); |
| 88 this._target.resourceTreeModel.addEventListener(WebInspector.ResourceTre
eModel.EventTypes.MainFrameNavigated, this._updateAnimationsPlaybackRate, this); | 88 this._target.resourceTreeModel.addEventListener(WebInspector.ResourceTre
eModel.EventTypes.MainFrameNavigated, this._updateAnimationsPlaybackRate, this); |
| 89 this._updateAnimationsPlaybackRate(); | 89 this._updateAnimationsPlaybackRate(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 } | 92 } |
| OLD | NEW |