Index: chrome/browser/resources/settings/animation/animation_group.js |
diff --git a/chrome/browser/resources/settings/animation/animation_group.js b/chrome/browser/resources/settings/animation/animation_group.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6439f3e3fa18dc329aa09e464de5a714bda71411 |
--- /dev/null |
+++ b/chrome/browser/resources/settings/animation/animation_group.js |
@@ -0,0 +1,48 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+cr.define('settings.animation', function() { |
+ 'use strict'; |
dschuyler
2016/07/21 03:26:09
Adding 'use strict' is cool, but why is it only ad
michaelpg
2016/07/22 16:05:50
Dunno, added it now. Thanks!
|
+ |
+ /** |
+ * An AnimationGroup manages a set of animations, handles any styling setup or |
+ * cleanup, and provides a Promise for chaining actions on finish or cancel. |
+ * This abstracts out all these details so UI elements can simply create an |
+ * object rather than individually track the state of every element, style and |
+ * web animation. AnimationGroups may compose web animations and other |
+ * AnimationGroups. |
+ * @interface |
+ */ |
+ function AnimationGroup() {} |
+ |
+ AnimationGroup.prototype = { |
+ /** |
+ * Sets up and plays the animation(s). |
+ * @return {!Promise} Convenient reference to |finished| for chaining. |
+ */ |
+ play: assertNotReached, |
+ |
+ /** |
+ * If animations are still playing, immediately finishes them and resolves |
+ * |finished|. |
+ */ |
+ finish: assertNotReached, |
+ |
+ /** |
+ * If animations are still playing, immediately cancels them and rejects |
+ * |finished|. |
+ */ |
+ cancel: assertNotReached, |
+ |
+ /** |
+ * Resolved or rejected when the the AnimationGroup finishes or is canceled. |
Dan Beam
2016/07/21 03:55:10
I think for no other reason than not having to cop
michaelpg
2016/07/22 16:05:50
Done.
|
+ * @type {?Promise} |
+ */ |
+ finished: null, |
+ }; |
+ |
+ return { |
+ AnimationGroup: AnimationGroup, |
+ }; |
+}); |