| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_COMPOSITOR_LAYER_ANIMATOR_H_ | 5 #ifndef UI_COMPOSITOR_LAYER_ANIMATOR_H_ |
| 6 #define UI_COMPOSITOR_LAYER_ANIMATOR_H_ | 6 #define UI_COMPOSITOR_LAYER_ANIMATOR_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "ui/base/animation/animation_container_element.h" | 16 #include "ui/base/animation/animation_container_element.h" |
| 17 #include "ui/base/animation/animation_container_test_helper.h" |
| 17 #include "ui/base/animation/tween.h" | 18 #include "ui/base/animation/tween.h" |
| 18 #include "ui/compositor/compositor_export.h" | 19 #include "ui/compositor/compositor_export.h" |
| 19 #include "ui/compositor/layer_animation_element.h" | 20 #include "ui/compositor/layer_animation_element.h" |
| 20 | 21 |
| 21 namespace gfx { | 22 namespace gfx { |
| 22 class Rect; | 23 class Rect; |
| 23 class Transform; | 24 class Transform; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace ui { | 27 namespace ui { |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 187 |
| 187 // When set to true, all animations complete immediately. | 188 // When set to true, all animations complete immediately. |
| 188 static void set_disable_animations_for_test(bool disable_animations) { | 189 static void set_disable_animations_for_test(bool disable_animations) { |
| 189 disable_animations_for_test_ = disable_animations; | 190 disable_animations_for_test_ = disable_animations; |
| 190 } | 191 } |
| 191 | 192 |
| 192 static bool disable_animations_for_test() { | 193 static bool disable_animations_for_test() { |
| 193 return disable_animations_for_test_; | 194 return disable_animations_for_test_; |
| 194 } | 195 } |
| 195 | 196 |
| 197 // Creates AnimationContainerTestHelper that would give fine control over |
| 198 // animation progress. Other test flags (disable_animations_for_test / |
| 199 // disable_timer_for_test) should be turned off. |
| 200 static scoped_ptr<test::AnimationContainerTestHelper> |
| 201 CreateAnimatorHelperForTest(); |
| 202 |
| 196 protected: | 203 protected: |
| 197 virtual ~LayerAnimator(); | 204 virtual ~LayerAnimator(); |
| 198 | 205 |
| 199 LayerAnimationDelegate* delegate() { return delegate_; } | 206 LayerAnimationDelegate* delegate() { return delegate_; } |
| 200 const LayerAnimationDelegate* delegate() const { return delegate_; } | 207 const LayerAnimationDelegate* delegate() const { return delegate_; } |
| 201 | 208 |
| 202 // Virtual for testing. | 209 // Virtual for testing. |
| 203 virtual void ProgressAnimation(LayerAnimationSequence* sequence, | 210 virtual void ProgressAnimation(LayerAnimationSequence* sequence, |
| 204 base::TimeDelta delta); | 211 base::TimeDelta delta); |
| 205 | 212 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 // Observers are notified when layer animations end, are scheduled or are | 363 // Observers are notified when layer animations end, are scheduled or are |
| 357 // aborted. | 364 // aborted. |
| 358 ObserverList<LayerAnimationObserver> observers_; | 365 ObserverList<LayerAnimationObserver> observers_; |
| 359 | 366 |
| 360 DISALLOW_COPY_AND_ASSIGN(LayerAnimator); | 367 DISALLOW_COPY_AND_ASSIGN(LayerAnimator); |
| 361 }; | 368 }; |
| 362 | 369 |
| 363 } // namespace ui | 370 } // namespace ui |
| 364 | 371 |
| 365 #endif // UI_COMPOSITOR_LAYER_ANIMATOR_H_ | 372 #endif // UI_COMPOSITOR_LAYER_ANIMATOR_H_ |
| OLD | NEW |