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_ANIMATION_CONTAINER_H_ | 5 #ifndef UI_BASE_ANIMATION_ANIMATION_CONTAINER_H_ |
6 #define UI_BASE_ANIMATION_ANIMATION_CONTAINER_H_ | 6 #define UI_BASE_ANIMATION_ANIMATION_CONTAINER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/time.h" | 12 #include "base/time.h" |
13 #include "base/timer.h" | 13 #include "base/timer.h" |
| 14 #include "ui/ui_api.h" |
14 | 15 |
15 namespace ui { | 16 namespace ui { |
16 | 17 |
17 class AnimationContainerElement; | 18 class AnimationContainerElement; |
18 class AnimationContainerObserver; | 19 class AnimationContainerObserver; |
19 | 20 |
20 // AnimationContainer is used by Animation to manage the underlying timer. | 21 // AnimationContainer is used by Animation to manage the underlying timer. |
21 // Internally each Animation creates a single AnimationContainer. You can | 22 // Internally each Animation creates a single AnimationContainer. You can |
22 // group a set of Animations into the same AnimationContainer by way of | 23 // group a set of Animations into the same AnimationContainer by way of |
23 // Animation::SetContainer. Grouping a set of Animations into the same | 24 // Animation::SetContainer. Grouping a set of Animations into the same |
24 // AnimationContainer ensures they all update and start at the same time. | 25 // AnimationContainer ensures they all update and start at the same time. |
25 // | 26 // |
26 // AnimationContainer is ref counted. Each Animation contained within the | 27 // AnimationContainer is ref counted. Each Animation contained within the |
27 // AnimationContainer own it. | 28 // AnimationContainer own it. |
28 class AnimationContainer : public base::RefCounted<AnimationContainer> { | 29 class UI_API AnimationContainer |
| 30 : public base::RefCounted<AnimationContainer> { |
29 public: | 31 public: |
30 AnimationContainer(); | 32 AnimationContainer(); |
31 | 33 |
32 // Invoked by Animation when it needs to start. Starts the timer if necessary. | 34 // Invoked by Animation when it needs to start. Starts the timer if necessary. |
33 // NOTE: This is invoked by Animation for you, you shouldn't invoke this | 35 // NOTE: This is invoked by Animation for you, you shouldn't invoke this |
34 // directly. | 36 // directly. |
35 void Start(AnimationContainerElement* animation); | 37 void Start(AnimationContainerElement* animation); |
36 | 38 |
37 // Invoked by Animation when it needs to stop. If there are no more animations | 39 // Invoked by Animation when it needs to stop. If there are no more animations |
38 // running the timer stops. | 40 // running the timer stops. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 base::RepeatingTimer<AnimationContainer> timer_; | 83 base::RepeatingTimer<AnimationContainer> timer_; |
82 | 84 |
83 AnimationContainerObserver* observer_; | 85 AnimationContainerObserver* observer_; |
84 | 86 |
85 DISALLOW_COPY_AND_ASSIGN(AnimationContainer); | 87 DISALLOW_COPY_AND_ASSIGN(AnimationContainer); |
86 }; | 88 }; |
87 | 89 |
88 } // namespace ui | 90 } // namespace ui |
89 | 91 |
90 #endif // UI_BASE_ANIMATION_ANIMATION_CONTAINER_H_ | 92 #endif // UI_BASE_ANIMATION_ANIMATION_CONTAINER_H_ |
OLD | NEW |