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

Unified Diff: third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js

Issue 1417173002: Devtools Animations: Pause button based on groups not global (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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: third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js b/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js
index 548f35c6aaffefd9773ed60c70f584dd916786cf..882e2b1ab73c5186d121b2fa85f1412429942803 100644
--- a/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js
@@ -602,6 +602,7 @@ WebInspector.AnimationModel.AnimationGroup = function(target, id, animations)
WebInspector.SDKObject.call(this, target);
this._id = id;
this._animations = animations;
+ this._paused = false;
}
WebInspector.AnimationModel.AnimationGroup.prototype = {
@@ -622,6 +623,23 @@ WebInspector.AnimationModel.AnimationGroup.prototype = {
},
/**
+ * @return {!Array.<string>}
+ */
+ _animationIds: function()
+ {
+ /**
+ * @param {!WebInspector.AnimationModel.Animation} animation
+ * @return {string}
+ */
+ function extractId(animation)
+ {
+ return animation.id();
+ }
+
+ return this._animations.map(extractId);
+ },
+
+ /**
* @return {number}
*/
startTime: function()
@@ -634,16 +652,24 @@ WebInspector.AnimationModel.AnimationGroup.prototype = {
*/
seekTo: function(currentTime)
{
- /**
- * @param {!WebInspector.AnimationModel.Animation} animation
- * @return {string}
- */
- function extractId(animation)
- {
- return animation.id();
- }
+ this.target().animationAgent().seekAnimations(this._animationIds(), currentTime);
+ },
+
+ /**
+ * @return {boolean}
+ */
+ paused: function()
+ {
+ return this._paused;
+ },
- this.target().animationAgent().seekAnimations(this._animations.map(extractId), currentTime);
+ /**
+ * @param {boolean} paused
+ */
+ togglePause: function(paused)
+ {
+ this._paused = paused;
+ this.target().animationAgent().setPaused(this._animationIds(), paused);
},
/**

Powered by Google App Engine
This is Rietveld 408576698