1 // Copyright (c) 2013 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.
7 tvcm.exportTo('tvcm.ui', function() {
9 * Represents a procedural animation that can be run by an
10 * tvcm.ui.AnimationController.
14 function Animation() {
17 Animation.prototype = {
20 * Called when an animation has been queued after a running animation.
22 * @return {boolean} True if the animation can take on the responsibilities
23 * of the running animation. If true, takeOverFor will be called on the
26 * This can be used to build animations that accelerate as pairs of them are
29 canTakeOverFor: function(existingAnimation) {
30 throw new Error('Not implemented');
34 * Called to take over responsiblities of an existingAnimation.
36 * At this point, the existingAnimation has been ticked one last time, then
37 * stopped. This animation will be started after this returns and has the
38 * job of finishing(or transitioning away from) the effect the existing
39 * animation was trying to accomplish.
41 takeOverFor: function(existingAnimation, newStartTimestamp, target) {
42 throw new Error('Not implemented');
45 start: function(timestamp, target) {
46 throw new Error('Not implemented');
50 * Called when an animation is stopped before it finishes. The animation can
51 * do what it wants here, usually nothing.
53 * @param {Number} timestamp When the animation was stopped.
54 * @param {Object} target The object being animated. May be undefined, take
56 * @param {boolean} willBeTakenOverByAnotherAnimation Whether this animation
57 * is going to be handed to another animation's takeOverFor function.
59 didStopEarly: function(timestamp, target,
60 willBeTakenOverByAnotherAnimation) {
64 * @return {boolean} true if the animation is finished.
66 tick: function(timestamp, target) {
67 throw new Error('Not implemented');