[Android] Remove the webview_core static library.
[chromium-blink-merge.git] / ui / compositor / scoped_layer_animation_settings.h
blob15388e24a77f65b5f8fe2ed8c2477e2a05704a9e
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
3 // found in the LICENSE file.
5 #ifndef UI_COMPOSITOR_SCOPED_LAYER_ANIMATION_SETTINGS_H_
6 #define UI_COMPOSITOR_SCOPED_LAYER_ANIMATION_SETTINGS_H_
8 #include <set>
10 #include "base/time.h"
12 #include "ui/base/animation/tween.h"
13 #include "ui/compositor/compositor_export.h"
14 #include "ui/compositor/layer_animator.h"
16 namespace ui {
18 class ImplicitAnimationObserver;
19 class LayerAnimationObserver;
21 // Scoped settings allow you to temporarily change the animator's settings and
22 // these changes are reverted when the object is destroyed. NOTE: when the
23 // settings object is created, it applies the default transition duration
24 // (200ms).
25 class COMPOSITOR_EXPORT ScopedLayerAnimationSettings {
26 public:
27 explicit ScopedLayerAnimationSettings(LayerAnimator* animator);
28 virtual ~ScopedLayerAnimationSettings();
30 void AddObserver(ImplicitAnimationObserver* observer);
32 void SetTransitionDuration(base::TimeDelta duration);
33 base::TimeDelta GetTransitionDuration() const;
35 void SetTweenType(Tween::Type tween_type);
36 Tween::Type GetTweenType() const;
38 void SetPreemptionStrategy(LayerAnimator::PreemptionStrategy strategy);
39 LayerAnimator::PreemptionStrategy GetPreemptionStrategy() const;
41 private:
42 LayerAnimator* animator_;
43 base::TimeDelta old_transition_duration_;
44 Tween::Type old_tween_type_;
45 LayerAnimator::PreemptionStrategy old_preemption_strategy_;
46 std::set<ImplicitAnimationObserver*> observers_;
48 DISALLOW_COPY_AND_ASSIGN(ScopedLayerAnimationSettings);
51 } // namespace ui
53 #endif // UI_COMPOSITOR_SCOPED_LAYER_ANIMATION_SETTINGS_H_