| 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 * @extends {WebInspector.StylesSidebarPane.BaseToolbarPaneWidget} | 7 * @extends {WebInspector.StylesSidebarPane.BaseToolbarPaneWidget} |
| 8 */ | 8 */ |
| 9 WebInspector.AnimationControlPane = function(toolbarItem) | 9 WebInspector.AnimationControlPane = function(toolbarItem) |
| 10 { | 10 { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 } | 34 } |
| 35 | 35 |
| 36 WebInspector.AnimationControlPane.prototype = { | 36 WebInspector.AnimationControlPane.prototype = { |
| 37 | 37 |
| 38 /** | 38 /** |
| 39 * @param {!Event} event | 39 * @param {!Event} event |
| 40 */ | 40 */ |
| 41 _playbackSliderInputHandler: function (event) | 41 _playbackSliderInputHandler: function (event) |
| 42 { | 42 { |
| 43 this._animationsPlaybackRate = WebInspector.AnimationTimeline.GlobalPlay
backRates[event.target.value]; | 43 this._animationsPlaybackRate = WebInspector.AnimationTimeline.GlobalPlay
backRates[event.target.value]; |
| 44 this._target.animationModel.setPlaybackRate(this._animationsPaused ? 0 :
this._animationsPlaybackRate); | 44 WebInspector.AnimationModel.fromTarget(this._target).setPlaybackRate(thi
s._animationsPaused ? 0 : this._animationsPlaybackRate); |
| 45 this._animationsPlaybackLabel.textContent = this._animationsPlaybackRate
+ "x"; | 45 this._animationsPlaybackLabel.textContent = this._animationsPlaybackRate
+ "x"; |
| 46 WebInspector.userMetrics.AnimationsPlaybackRateChanged.record(); | 46 WebInspector.userMetrics.AnimationsPlaybackRateChanged.record(); |
| 47 }, | 47 }, |
| 48 | 48 |
| 49 _pauseButtonHandler: function () | 49 _pauseButtonHandler: function () |
| 50 { | 50 { |
| 51 this._animationsPaused = !this._animationsPaused; | 51 this._animationsPaused = !this._animationsPaused; |
| 52 this._target.animationModel.setPlaybackRate(this._animationsPaused ? 0 :
this._animationsPlaybackRate); | 52 WebInspector.AnimationModel.fromTarget(this._target).setPlaybackRate(thi
s._animationsPaused ? 0 : this._animationsPlaybackRate); |
| 53 WebInspector.userMetrics.AnimationsPlaybackRateChanged.record(); | 53 WebInspector.userMetrics.AnimationsPlaybackRateChanged.record(); |
| 54 this._animationsPauseButton.element.classList.toggle("pause-toolbar-item
"); | 54 this._animationsPauseButton.element.classList.toggle("pause-toolbar-item
"); |
| 55 this._animationsPauseButton.element.classList.toggle("play-toolbar-item"
); | 55 this._animationsPauseButton.element.classList.toggle("play-toolbar-item"
); |
| 56 }, | 56 }, |
| 57 | 57 |
| 58 /** | 58 /** |
| 59 * @param {!WebInspector.Event=} event | 59 * @param {!WebInspector.Event=} event |
| 60 */ | 60 */ |
| 61 _updateAnimationsPlaybackRate: function(event) | 61 _updateAnimationsPlaybackRate: function(event) |
| 62 { | 62 { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 /** | 143 /** |
| 144 * @override | 144 * @override |
| 145 * @return {!WebInspector.ToolbarItem} | 145 * @return {!WebInspector.ToolbarItem} |
| 146 */ | 146 */ |
| 147 item: function() | 147 item: function() |
| 148 { | 148 { |
| 149 return this._button; | 149 return this._button; |
| 150 } | 150 } |
| 151 } | 151 } |
| OLD | NEW |