Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Side by Side Diff: Source/devtools/front_end/animation/AnimationControlPane.js

Issue 1151263007: Devtools: Move animation to separate module (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/devtools.gypi ('k') | Source/devtools/front_end/animation/AnimationModel.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « Source/devtools/devtools.gypi ('k') | Source/devtools/front_end/animation/AnimationModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698