1 // Copyright 2015 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 ASH_ROTATOR_SCREEN_ROTATION_ANIMATION_H_
6 #define ASH_ROTATOR_SCREEN_ROTATION_ANIMATION_H_
10 #include "ash/ash_export.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/time/time.h"
13 #include "ui/compositor/layer_animation_element.h"
14 #include "ui/gfx/animation/tween.h"
15 #include "ui/gfx/geometry/point.h"
18 class InterpolatedTransform
;
24 // A LayerAnimationElement that will animate a layer by rotating it around a
26 class ASH_EXPORT ScreenRotationAnimation
: public ui::LayerAnimationElement
{
28 // Creates an animation element that will rotate |layer| from |start_degrees|
29 // to |end_degrees| around the given |pivot| and will take |duration| amount
31 ScreenRotationAnimation(ui::Layer
* layer
,
34 float initial_opacity
,
37 base::TimeDelta duration
,
38 gfx::Tween::Type twen_type
);
39 ~ScreenRotationAnimation() override
;
42 // Implementation of ui::LayerAnimationDelegate
43 void OnStart(ui::LayerAnimationDelegate
* delegate
) override
;
44 bool OnProgress(double current
,
45 ui::LayerAnimationDelegate
* delegate
) override
;
46 void OnGetTarget(TargetValue
* target
) const override
;
47 void OnAbort(ui::LayerAnimationDelegate
* delegate
) override
;
49 // The root InterpolatedTransform that defines the animation.
50 scoped_ptr
<ui::InterpolatedTransform
> interpolated_transform_
;
52 // The Tween type to use for the animation.
53 gfx::Tween::Type tween_type_
;
55 // The initial layer opacity to start the animation with.
56 float initial_opacity_
;
58 // The target layer opacity to end the animation with.
59 float target_opacity_
;
61 DISALLOW_COPY_AND_ASSIGN(ScreenRotationAnimation
);
66 #endif // ASH_ROTATOR_SCREEN_ROTATION_ANIMATION_H_