Files.app: Show surprise-unplug warning on kDiskRemoved event rather than kDeviceRemoved.
[chromium-blink-merge.git] / cc / animation / timing_function.h
blob647701f30ce596627279804ab0d6a765d04b209a
1 // Copyright 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 CC_ANIMATION_TIMING_FUNCTION_H_
6 #define CC_ANIMATION_TIMING_FUNCTION_H_
8 #include "cc/animation/animation_curve.h"
9 #include "cc/base/cc_export.h"
10 #include "ui/gfx/geometry/cubic_bezier.h"
12 namespace cc {
14 // See http://www.w3.org/TR/css3-transitions/.
15 class CC_EXPORT TimingFunction : public FloatAnimationCurve {
16 public:
17 virtual ~TimingFunction();
19 // Partial implementation of FloatAnimationCurve.
20 virtual double Duration() const OVERRIDE;
22 // The smallest and largest values returned by GetValue for inputs in
23 // [0, 1].
24 virtual void Range(float* min, float* max) const = 0;
26 protected:
27 TimingFunction();
29 private:
30 DISALLOW_ASSIGN(TimingFunction);
33 class CC_EXPORT CubicBezierTimingFunction : public TimingFunction {
34 public:
35 static scoped_ptr<CubicBezierTimingFunction> Create(double x1, double y1,
36 double x2, double y2);
37 virtual ~CubicBezierTimingFunction();
39 // Partial implementation of FloatAnimationCurve.
40 virtual float GetValue(double time) const OVERRIDE;
41 virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE;
43 virtual void Range(float* min, float* max) const OVERRIDE;
45 protected:
46 CubicBezierTimingFunction(double x1, double y1, double x2, double y2);
48 gfx::CubicBezier bezier_;
50 private:
51 DISALLOW_ASSIGN(CubicBezierTimingFunction);
54 class CC_EXPORT EaseTimingFunction {
55 public:
56 static scoped_ptr<TimingFunction> Create();
58 private:
59 DISALLOW_IMPLICIT_CONSTRUCTORS(EaseTimingFunction);
62 class CC_EXPORT EaseInTimingFunction {
63 public:
64 static scoped_ptr<TimingFunction> Create();
66 private:
67 DISALLOW_IMPLICIT_CONSTRUCTORS(EaseInTimingFunction);
70 class CC_EXPORT EaseOutTimingFunction {
71 public:
72 static scoped_ptr<TimingFunction> Create();
74 private:
75 DISALLOW_IMPLICIT_CONSTRUCTORS(EaseOutTimingFunction);
78 class CC_EXPORT EaseInOutTimingFunction {
79 public:
80 static scoped_ptr<TimingFunction> Create();
82 private:
83 DISALLOW_IMPLICIT_CONSTRUCTORS(EaseInOutTimingFunction);
86 } // namespace cc
88 #endif // CC_ANIMATION_TIMING_FUNCTION_H_