Chromium Code Reviews| 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_SCOPED_LAYER_ANIMATION_SETTINGS_H_ | 5 #ifndef UI_COMPOSITOR_SCOPED_LAYER_ANIMATION_SETTINGS_H_ |
| 6 #define UI_COMPOSITOR_SCOPED_LAYER_ANIMATION_SETTINGS_H_ | 6 #define UI_COMPOSITOR_SCOPED_LAYER_ANIMATION_SETTINGS_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 class COMPOSITOR_EXPORT ScopedLayerAnimationSettings { | 27 class COMPOSITOR_EXPORT ScopedLayerAnimationSettings { |
| 28 public: | 28 public: |
| 29 explicit ScopedLayerAnimationSettings(LayerAnimator* animator); | 29 explicit ScopedLayerAnimationSettings(LayerAnimator* animator); |
| 30 virtual ~ScopedLayerAnimationSettings(); | 30 virtual ~ScopedLayerAnimationSettings(); |
| 31 | 31 |
| 32 void AddObserver(ImplicitAnimationObserver* observer); | 32 void AddObserver(ImplicitAnimationObserver* observer); |
| 33 | 33 |
| 34 void SetTransitionDuration(base::TimeDelta duration); | 34 void SetTransitionDuration(base::TimeDelta duration); |
| 35 base::TimeDelta GetTransitionDuration() const; | 35 base::TimeDelta GetTransitionDuration() const; |
| 36 | 36 |
| 37 // Lock transition duration in |animator_|. When transition duration | |
| 38 // is locked any subsequent changes to it are ignored until the | |
| 39 // ScopedLayerAnimationSettings object that has locked the duration goes out | |
| 40 // of scope or until some ScopedLayerAnimationSettings object unlocks the | |
| 41 // transition duration. | |
| 42 void SetTransitionDurationLocked(bool is_locked); | |
|
Ian Vollick
2013/11/29 04:33:31
How would you feel about changing this to void Loc
varkha
2013/11/29 06:05:54
Done. I like it - less things to test.
| |
| 43 | |
| 37 void SetTweenType(gfx::Tween::Type tween_type); | 44 void SetTweenType(gfx::Tween::Type tween_type); |
| 38 gfx::Tween::Type GetTweenType() const; | 45 gfx::Tween::Type GetTweenType() const; |
| 39 | 46 |
| 40 void SetPreemptionStrategy(LayerAnimator::PreemptionStrategy strategy); | 47 void SetPreemptionStrategy(LayerAnimator::PreemptionStrategy strategy); |
| 41 LayerAnimator::PreemptionStrategy GetPreemptionStrategy() const; | 48 LayerAnimator::PreemptionStrategy GetPreemptionStrategy() const; |
| 42 | 49 |
| 43 // Sets the base layer whose animation will be countered. | 50 // Sets the base layer whose animation will be countered. |
| 44 void SetInverselyAnimatedBaseLayer(Layer* base); | 51 void SetInverselyAnimatedBaseLayer(Layer* base); |
| 45 | 52 |
| 46 // Adds the layer to be counter-animated when a transform animation is | 53 // Adds the layer to be counter-animated when a transform animation is |
| 47 // scheduled on the animator_. Must call SetInverselyAnimatedBaseLayer with | 54 // scheduled on the animator_. Must call SetInverselyAnimatedBaseLayer with |
| 48 // the layer associated with animator_ before animating. | 55 // the layer associated with animator_ before animating. |
| 49 void AddInverselyAnimatedLayer(Layer* inverse_layer); | 56 void AddInverselyAnimatedLayer(Layer* inverse_layer); |
| 50 | 57 |
| 51 private: | 58 private: |
| 52 LayerAnimator* animator_; | 59 LayerAnimator* animator_; |
| 60 bool is_transition_duration_locked_; | |
| 61 bool old_is_transition_duration_locked_; | |
| 53 base::TimeDelta old_transition_duration_; | 62 base::TimeDelta old_transition_duration_; |
| 54 gfx::Tween::Type old_tween_type_; | 63 gfx::Tween::Type old_tween_type_; |
| 55 LayerAnimator::PreemptionStrategy old_preemption_strategy_; | 64 LayerAnimator::PreemptionStrategy old_preemption_strategy_; |
| 56 std::set<ImplicitAnimationObserver*> observers_; | 65 std::set<ImplicitAnimationObserver*> observers_; |
| 57 scoped_ptr<InvertingObserver> inverse_observer_; | 66 scoped_ptr<InvertingObserver> inverse_observer_; |
| 58 | 67 |
| 59 DISALLOW_COPY_AND_ASSIGN(ScopedLayerAnimationSettings); | 68 DISALLOW_COPY_AND_ASSIGN(ScopedLayerAnimationSettings); |
| 60 }; | 69 }; |
| 61 | 70 |
| 62 } // namespace ui | 71 } // namespace ui |
| 63 | 72 |
| 64 #endif // UI_COMPOSITOR_SCOPED_LAYER_ANIMATION_SETTINGS_H_ | 73 #endif // UI_COMPOSITOR_SCOPED_LAYER_ANIMATION_SETTINGS_H_ |
| OLD | NEW |