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_BASE_ANIMATION_MULTI_ANIMATION_H_ | 5 #ifndef UI_BASE_ANIMATION_MULTI_ANIMATION_H_ |
6 #define UI_BASE_ANIMATION_MULTI_ANIMATION_H_ | 6 #define UI_BASE_ANIMATION_MULTI_ANIMATION_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ui/base/animation/animation.h" | 10 #include "ui/base/animation/animation.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 type(type) {} | 38 type(type) {} |
39 | 39 |
40 int time_ms; | 40 int time_ms; |
41 int start_time_ms; | 41 int start_time_ms; |
42 int end_time_ms; | 42 int end_time_ms; |
43 Tween::Type type; | 43 Tween::Type type; |
44 }; | 44 }; |
45 | 45 |
46 typedef std::vector<Part> Parts; | 46 typedef std::vector<Part> Parts; |
47 | 47 |
48 explicit MultiAnimation(const Parts& parts); | 48 MultiAnimation(const Parts& parts, base::TimeDelta timer_interval); |
49 virtual ~MultiAnimation(); | 49 virtual ~MultiAnimation(); |
50 | 50 |
| 51 // Default interval. |
| 52 static base::TimeDelta GetDefaultTimerInterval(); |
| 53 |
51 // 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 |
52 // animation runs until explicitly stopped. The default is true. | 55 // animation runs until explicitly stopped. The default is true. |
53 void set_continuous(bool continuous) { continuous_ = continuous; } | 56 void set_continuous(bool continuous) { continuous_ = continuous; } |
54 | 57 |
55 // Returns the current value. The current value for a MultiAnimation is | 58 // Returns the current value. The current value for a MultiAnimation is |
56 // determined from the tween type of the current part. | 59 // determined from the tween type of the current part. |
57 virtual double GetCurrentValue() const OVERRIDE; | 60 virtual double GetCurrentValue() const OVERRIDE; |
58 | 61 |
59 // Returns the index of the current part. | 62 // Returns the index of the current part. |
60 size_t current_part_index() const { return current_part_index_; } | 63 size_t current_part_index() const { return current_part_index_; } |
(...skipping 23 matching lines...) Expand all Loading... |
84 | 87 |
85 // See description above setter. | 88 // See description above setter. |
86 bool continuous_; | 89 bool continuous_; |
87 | 90 |
88 DISALLOW_COPY_AND_ASSIGN(MultiAnimation); | 91 DISALLOW_COPY_AND_ASSIGN(MultiAnimation); |
89 }; | 92 }; |
90 | 93 |
91 } // namespace ui | 94 } // namespace ui |
92 | 95 |
93 #endif // UI_BASE_ANIMATION_MULTI_ANIMATION_H_ | 96 #endif // UI_BASE_ANIMATION_MULTI_ANIMATION_H_ |
OLD | NEW |