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

Unified Diff: chrome/browser/resources/settings/animation/transition.js

Issue 2072643002: MD Settings: animation interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: simplify Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/animation/transition.js
diff --git a/chrome/browser/resources/settings/animation/transition.js b/chrome/browser/resources/settings/animation/transition.js
new file mode 100644
index 0000000000000000000000000000000000000000..6d562c959e0006dbfdaf43838e9c4ba03ecf1500
--- /dev/null
+++ b/chrome/browser/resources/settings/animation/transition.js
@@ -0,0 +1,51 @@
+// 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.
+
+/**
+ * @fileoverview
+ * Transitions are cancellable asynchronous state changes. A transition may
+ * compose web animations and other Transitions to manage a set of animations.
+ * Similar to Promises, they can initiate tasks after completion or
+ * cancellation.
+ */
+cr.define('settings.animation', function() {
+ 'use strict';
+
+ /**
+ * Base class for modular implementations of asynchronous transitions using
+ * web animations.
+ * @constructor
+ */
+ function Transition() {}
+
+ Transition.prototype = {
+ /**
+ * Starts the transition, including scheduling any animations.
+ * @return {!Promise} Convenient reference to |finished| for chaining.
+ */
+ play: function() {},
Dan Beam 2016/07/01 00:33:24 shouldn't this also be assertNotReached() or somet
michaelpg 2016/07/01 20:21:46 Done.
+
+ /**
+ * If the transition is still playing, immediately finishes it and resolves
+ * |finished|.
+ */
+ finish: assertNotReached,
+
+ /**
+ * If the transition is still playing, immediately cancels it and rejects
+ * |finished|.
+ */
+ cancel: assertNotReached,
+
+ /**
+ * Resolved or rejected when the transition is finished or canceled.
+ * @type {?Promise}
+ */
+ finished: null,
+ };
+
+ return {
+ Transition: Transition,
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698