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

Side by Side Diff: chrome/browser/resources/settings/animation/animation_group.js

Issue 2171373003: AnimationGroup for groups of transitions in Settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 cr.define('settings.animation', function() {
6 'use strict';
7
8 /**
9 * An AnimationGroup manages a set of animations, handles any styling setup or
10 * cleanup, and provides a Promise for chaining actions on finish or cancel.
11 * This abstracts out all these details so UI elements can simply create an
12 * object rather than individually track the state of every element, style and
13 * web animation. AnimationGroups may compose web animations and other
14 * AnimationGroups.
15 * @interface
16 */
17 function AnimationGroup() {}
18
19 AnimationGroup.prototype = {
20 /**
21 * Sets up and plays the animation(s).
22 * @return {!Promise} Convenient reference to |finished| for chaining.
23 */
24 play: assertNotReached,
25
26 /**
27 * If animations are still playing, immediately finishes them and resolves
28 * |finished| with the |true| value.
29 */
30 finish: assertNotReached,
31
32 /**
33 * If animations are still playing, immediately cancels them and resolves
34 * |finished| with the |false| value.
35 */
36 cancel: assertNotReached,
37
38 /**
39 * Resolved with a success value once the AnimationGroup finishes (true) or
40 * is canceled (false).
41 * @type {?Promise<boolean>}
42 */
43 finished: null,
44 };
45
46 return {
47 AnimationGroup: AnimationGroup,
48 };
49 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698