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_SCROLLBAR_ANIMATION_CONTROLLER_LINEAR_FADE_H_
6 #define CC_SCROLLBAR_ANIMATION_CONTROLLER_LINEAR_FADE_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "cc/cc_export.h"
10 #include "cc/scrollbar_animation_controller.h"
15 class CC_EXPORT ScrollbarAnimationControllerLinearFade
: public ScrollbarAnimationController
{
17 static scoped_ptr
<ScrollbarAnimationControllerLinearFade
> create(LayerImpl
* scrollLayer
, double fadeoutDelay
, double fadeoutLength
);
19 virtual ~ScrollbarAnimationControllerLinearFade();
21 // ScrollbarAnimationController overrides.
22 virtual bool animate(base::TimeTicks
) OVERRIDE
;
23 virtual void didPinchGestureUpdate(base::TimeTicks
) OVERRIDE
;
24 virtual void didPinchGestureEnd(base::TimeTicks
) OVERRIDE
;
25 virtual void didUpdateScrollOffset(base::TimeTicks
) OVERRIDE
;
28 ScrollbarAnimationControllerLinearFade(LayerImpl
* scrollLayer
, double fadeoutDelay
, double fadeoutLength
);
31 float opacityAtTime(base::TimeTicks
);
33 LayerImpl
* m_scrollLayer
;
35 base::TimeTicks m_lastAwakenTime
;
36 bool m_pinchGestureInEffect
;
38 double m_fadeoutDelay
;
39 double m_fadeoutLength
;
41 double m_currentTimeForTesting
;
46 #endif // CC_SCROLLBAR_ANIMATION_CONTROLLER_LINEAR_FADE_H_