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_COMPOSITOR_LAYER_ANIMATOR_H_ | 5 #ifndef UI_GFX_COMPOSITOR_LAYER_ANIMATOR_H_ |
6 #define UI_GFX_COMPOSITOR_LAYER_ANIMATOR_H_ | 6 #define UI_GFX_COMPOSITOR_LAYER_ANIMATOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <set> | 10 #include <set> |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 // These functions are used for adding or removing observers from the observer | 116 // These functions are used for adding or removing observers from the observer |
117 // list. The observers are notified when animations end. | 117 // list. The observers are notified when animations end. |
118 void AddObserver(LayerAnimationObserver* observer); | 118 void AddObserver(LayerAnimationObserver* observer); |
119 void RemoveObserver(LayerAnimationObserver* observer); | 119 void RemoveObserver(LayerAnimationObserver* observer); |
120 | 120 |
121 // Scoped settings allow you to temporarily change the animator's settings and | 121 // Scoped settings allow you to temporarily change the animator's settings and |
122 // these changes are reverted when the object is destroyed. NOTE: when the | 122 // these changes are reverted when the object is destroyed. NOTE: when the |
123 // settings object is created, it applies the default transition duration | 123 // settings object is created, it applies the default transition duration |
124 // (200ms). | 124 // (200ms). |
125 class ScopedSettings { | 125 class COMPOSITOR_EXPORT ScopedSettings { |
126 public: | 126 public: |
127 explicit ScopedSettings(LayerAnimator* animator); | 127 explicit ScopedSettings(LayerAnimator* animator); |
128 virtual ~ScopedSettings(); | 128 virtual ~ScopedSettings(); |
129 | 129 |
130 void AddObserver(LayerAnimationObserver* observer); | 130 void AddObserver(LayerAnimationObserver* observer); |
131 void SetTransitionDuration(base::TimeDelta duration); | 131 void SetTransitionDuration(base::TimeDelta duration); |
132 | 132 |
133 private: | 133 private: |
134 LayerAnimator* animator_; | 134 LayerAnimator* animator_; |
135 base::TimeDelta old_transition_duration_; | 135 base::TimeDelta old_transition_duration_; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 // Observers are notified when layer animations end, are scheduled or are | 251 // Observers are notified when layer animations end, are scheduled or are |
252 // aborted. | 252 // aborted. |
253 ObserverList<LayerAnimationObserver> observers_; | 253 ObserverList<LayerAnimationObserver> observers_; |
254 | 254 |
255 DISALLOW_COPY_AND_ASSIGN(LayerAnimator); | 255 DISALLOW_COPY_AND_ASSIGN(LayerAnimator); |
256 }; | 256 }; |
257 | 257 |
258 } // namespace ui | 258 } // namespace ui |
259 | 259 |
260 #endif // UI_GFX_COMPOSITOR_LAYER_ANIMATOR_H_ | 260 #endif // UI_GFX_COMPOSITOR_LAYER_ANIMATOR_H_ |
OLD | NEW |