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

Unified Diff: Source/devtools/front_end/elements/AnimationTimeline.js

Issue 1081753002: Devtools Animations: Support multiple frames in the animation timeline (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Set playback rate on new frames Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/elements/AnimationTimeline.js
diff --git a/Source/devtools/front_end/elements/AnimationTimeline.js b/Source/devtools/front_end/elements/AnimationTimeline.js
index d3602f75df04280ad6bc2c632ed9ed2de0742ff0..55a75eea9ac344ba6ca3104cf26f0806bc4c1317 100644
--- a/Source/devtools/front_end/elements/AnimationTimeline.js
+++ b/Source/devtools/front_end/elements/AnimationTimeline.js
@@ -32,6 +32,7 @@ WebInspector.AnimationTimeline = function()
this._animationsMap = new Map();
WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._mainFrameNavigated, this);
WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebInspector.DOMModel.Events.NodeRemoved, this._nodeRemoved, this);
+ WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.FrameAdded, this._frameAdded, this);
}
WebInspector.AnimationTimeline.prototype = {
@@ -46,7 +47,7 @@ WebInspector.AnimationTimeline.prototype = {
this._animationsPlaybackRate = WebInspector.AnimationsSidebarPane.GlobalPlaybackRates[event.target.value];
var target = WebInspector.targetManager.mainTarget();
if (target)
- target.animationAgent().setPlaybackRate(this._animationsPlaybackRate);
+ target.animationModel.setPlaybackRate(this._animationsPlaybackRate);
this._playbackLabel.textContent = this._animationsPlaybackRate + "x";
WebInspector.userMetrics.AnimationsPlaybackRateChanged.record();
if (this._scrubberPlayer)
@@ -171,6 +172,16 @@ WebInspector.AnimationTimeline.prototype = {
},
/**
+ * @param {!WebInspector.Event} event
+ */
+ _frameAdded: function(event)
+ {
+ var target = WebInspector.targetManager.mainTarget();
+ if (target && this._animationsPlaybackRate)
+ target.animationModel.setPlaybackRate(this._animationsPlaybackRate);
pfeldman 2015/04/14 09:37:53 You want to instrument it on the backend and set c
samli 2015/04/15 03:19:16 Done. PTAL, couldn't use the regular frame added i
+ },
+
+ /**
* @param {!WebInspector.AnimationModel.AnimationPlayer} animation
* @param {boolean} resetTimeline
*/
@@ -366,7 +377,7 @@ WebInspector.AnimationTimeline.prototype = {
var target = WebInspector.targetManager.mainTarget();
if (target)
- target.animationAgent().setPlaybackRate(0);
+ target.animationModel.setPlaybackRate(0);
return true;
},
@@ -394,7 +405,7 @@ WebInspector.AnimationTimeline.prototype = {
this._timelineScrubberHead.window().requestAnimationFrame(this._updateScrubber.bind(this));
var target = WebInspector.targetManager.mainTarget();
if (target)
- target.animationAgent().setPlaybackRate(this._animationsPlaybackRate);
+ target.animationModel.setPlaybackRate(this._animationsPlaybackRate);
},
__proto__: WebInspector.VBox.prototype
« no previous file with comments | « Source/devtools/front_end/elements/AnimationControlPane.js ('k') | Source/devtools/front_end/sdk/AnimationModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698