OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 APP_MULTI_ANIMATION_H_ | 5 #ifndef APP_MULTI_ANIMATION_H_ |
6 #define APP_MULTI_ANIMATION_H_ | 6 #define APP_MULTI_ANIMATION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // Returns the current value. The current value for a MultiAnimation is | 54 // Returns the current value. The current value for a MultiAnimation is |
55 // determined from the tween type of the current part. | 55 // determined from the tween type of the current part. |
56 virtual double GetCurrentValue() const { return current_value_; } | 56 virtual double GetCurrentValue() const { return current_value_; } |
57 | 57 |
58 // Returns the index of the current part. | 58 // Returns the index of the current part. |
59 size_t current_part_index() const { return current_part_index_; } | 59 size_t current_part_index() const { return current_part_index_; } |
60 | 60 |
61 protected: | 61 protected: |
62 // Animation overrides. | 62 // Animation overrides. |
63 virtual void Step(base::TimeTicks time_now); | 63 virtual void Step(base::TimeTicks time_now); |
| 64 virtual void SetStartTime(base::TimeTicks start_time); |
64 | 65 |
65 private: | 66 private: |
66 // Returns the part containing the specified time. |time_ms| is reset to be | 67 // Returns the part containing the specified time. |time_ms| is reset to be |
67 // relative to the part containing the time and |part_index| the index of the | 68 // relative to the part containing the time and |part_index| the index of the |
68 // part. | 69 // part. |
69 const Part& GetPart(int* time_ms, size_t* part_index); | 70 const Part& GetPart(int* time_ms, size_t* part_index); |
70 | 71 |
71 // The parts that make up the animation. | 72 // The parts that make up the animation. |
72 const Parts parts_; | 73 const Parts parts_; |
73 | 74 |
74 // Total time of all the parts. | 75 // Total time of all the parts. |
75 const int cycle_time_ms_; | 76 const int cycle_time_ms_; |
76 | 77 |
77 // Current value for the animation. | 78 // Current value for the animation. |
78 double current_value_; | 79 double current_value_; |
79 | 80 |
80 // Index of the current part. | 81 // Index of the current part. |
81 size_t current_part_index_; | 82 size_t current_part_index_; |
82 | 83 |
83 // See description above setter. | 84 // See description above setter. |
84 bool continuous_; | 85 bool continuous_; |
85 | 86 |
86 DISALLOW_COPY_AND_ASSIGN(MultiAnimation); | 87 DISALLOW_COPY_AND_ASSIGN(MultiAnimation); |
87 }; | 88 }; |
88 | 89 |
89 #endif // APP_MULTI_ANIMATION_H_ | 90 #endif // APP_MULTI_ANIMATION_H_ |
OLD | NEW |