OLD | NEW |
1 // Copyright (c) 2011 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 | 4 |
5 #ifndef UI_GFX_ANIMATION_MULTI_ANIMATION_H_ | 5 #ifndef UI_GFX_ANIMATION_MULTI_ANIMATION_H_ |
6 #define UI_GFX_ANIMATION_MULTI_ANIMATION_H_ | 6 #define UI_GFX_ANIMATION_MULTI_ANIMATION_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ui/gfx/animation/animation.h" | 10 #include "ui/gfx/animation/animation.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 // Default interval. | 51 // Default interval. |
52 static base::TimeDelta GetDefaultTimerInterval(); | 52 static base::TimeDelta GetDefaultTimerInterval(); |
53 | 53 |
54 // Sets whether the animation continues after it reaches the end. If true, the | 54 // Sets whether the animation continues after it reaches the end. If true, the |
55 // animation runs until explicitly stopped. The default is true. | 55 // animation runs until explicitly stopped. The default is true. |
56 void set_continuous(bool continuous) { continuous_ = continuous; } | 56 void set_continuous(bool continuous) { continuous_ = continuous; } |
57 | 57 |
58 // Returns the current value. The current value for a MultiAnimation is | 58 // Returns the current value. The current value for a MultiAnimation is |
59 // determined from the tween type of the current part. | 59 // determined from the tween type of the current part. |
60 virtual double GetCurrentValue() const OVERRIDE; | 60 virtual double GetCurrentValue() const override; |
61 | 61 |
62 // Returns the index of the current part. | 62 // Returns the index of the current part. |
63 size_t current_part_index() const { return current_part_index_; } | 63 size_t current_part_index() const { return current_part_index_; } |
64 | 64 |
65 protected: | 65 protected: |
66 // Animation overrides. | 66 // Animation overrides. |
67 virtual void Step(base::TimeTicks time_now) OVERRIDE; | 67 virtual void Step(base::TimeTicks time_now) override; |
68 virtual void SetStartTime(base::TimeTicks start_time) OVERRIDE; | 68 virtual void SetStartTime(base::TimeTicks start_time) override; |
69 | 69 |
70 private: | 70 private: |
71 // Returns the part containing the specified time. |time_ms| is reset to be | 71 // Returns the part containing the specified time. |time_ms| is reset to be |
72 // relative to the part containing the time and |part_index| the index of the | 72 // relative to the part containing the time and |part_index| the index of the |
73 // part. | 73 // part. |
74 const Part& GetPart(int* time_ms, size_t* part_index); | 74 const Part& GetPart(int* time_ms, size_t* part_index); |
75 | 75 |
76 // The parts that make up the animation. | 76 // The parts that make up the animation. |
77 const Parts parts_; | 77 const Parts parts_; |
78 | 78 |
79 // Total time of all the parts. | 79 // Total time of all the parts. |
80 const int cycle_time_ms_; | 80 const int cycle_time_ms_; |
81 | 81 |
82 // Current value for the animation. | 82 // Current value for the animation. |
83 double current_value_; | 83 double current_value_; |
84 | 84 |
85 // Index of the current part. | 85 // Index of the current part. |
86 size_t current_part_index_; | 86 size_t current_part_index_; |
87 | 87 |
88 // See description above setter. | 88 // See description above setter. |
89 bool continuous_; | 89 bool continuous_; |
90 | 90 |
91 DISALLOW_COPY_AND_ASSIGN(MultiAnimation); | 91 DISALLOW_COPY_AND_ASSIGN(MultiAnimation); |
92 }; | 92 }; |
93 | 93 |
94 } // namespace gfx | 94 } // namespace gfx |
95 | 95 |
96 #endif // UI_GFX_ANIMATION_MULTI_ANIMATION_H_ | 96 #endif // UI_GFX_ANIMATION_MULTI_ANIMATION_H_ |
OLD | NEW |