| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // Inspired by NSAnimation | |
| 5 | 4 |
| 6 #ifndef APP_LINEAR_ANIMATION_H_ | 5 #ifndef UI_BASE_ANIMATION_LINEAR_ANIMATION_H_ |
| 7 #define APP_LINEAR_ANIMATION_H_ | 6 #define UI_BASE_ANIMATION_LINEAR_ANIMATION_H_ |
| 8 #pragma once | 7 #pragma once |
| 9 | 8 |
| 10 #include "app/animation.h" | |
| 11 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "ui/base/animation/animation.h" |
| 11 |
| 12 namespace ui { |
| 12 | 13 |
| 13 class AnimationDelegate; | 14 class AnimationDelegate; |
| 14 | 15 |
| 15 // Linear time bounded animation. As the animation progresses AnimateToState is | 16 // Linear time bounded animation. As the animation progresses AnimateToState is |
| 16 // invoked. | 17 // invoked. |
| 17 class LinearAnimation : public Animation { | 18 class LinearAnimation : public Animation { |
| 18 public: | 19 public: |
| 19 // Initializes everything except the duration. | 20 // Initializes everything except the duration. |
| 20 // | 21 // |
| 21 // Caller must make sure to call SetDuration() if they use this | 22 // Caller must make sure to call SetDuration() if they use this |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // Current state, on a scale from 0.0 to 1.0. | 62 // Current state, on a scale from 0.0 to 1.0. |
| 62 double state_; | 63 double state_; |
| 63 | 64 |
| 64 // If true, we're in end. This is used to determine if the animation should | 65 // If true, we're in end. This is used to determine if the animation should |
| 65 // be advanced to the end from AnimationStopped. | 66 // be advanced to the end from AnimationStopped. |
| 66 bool in_end_; | 67 bool in_end_; |
| 67 | 68 |
| 68 DISALLOW_COPY_AND_ASSIGN(LinearAnimation); | 69 DISALLOW_COPY_AND_ASSIGN(LinearAnimation); |
| 69 }; | 70 }; |
| 70 | 71 |
| 72 } // namespace ui |
| 73 |
| 71 #endif // APP_LINEAR_ANIMATION_H_ | 74 #endif // APP_LINEAR_ANIMATION_H_ |
| OLD | NEW |