Switch global error menu icon to vectorized MD asset
[chromium-blink-merge.git] / ash / rotator / screen_rotation_animation.h
blob70f68721a1714ecec1ba86df02e05f0d6fc768a9
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_
8 #include <stdint.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"
17 namespace ui {
18 class InterpolatedTransform;
19 class Layer;
22 namespace ash {
24 // A LayerAnimationElement that will animate a layer by rotating it around a
25 // pivot point.
26 class ASH_EXPORT ScreenRotationAnimation : public ui::LayerAnimationElement {
27 public:
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
30 // of time.
31 ScreenRotationAnimation(ui::Layer* layer,
32 int start_degrees,
33 int end_degrees,
34 float initial_opacity,
35 float target_opacity,
36 gfx::Point pivot,
37 base::TimeDelta duration,
38 gfx::Tween::Type twen_type);
39 ~ScreenRotationAnimation() override;
41 private:
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);
64 } // namespace ash
66 #endif // ASH_ROTATOR_SCREEN_ROTATION_ANIMATION_H_