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_SCROLLBAR_ANIMATION_CONTROLLER_LINEAR_FADE_H_
6 #define CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_LINEAR_FADE_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "cc/animation/scrollbar_animation_controller.h"
10 #include "cc/base/cc_export.h"
15 class CC_EXPORT ScrollbarAnimationControllerLinearFade
16 : public ScrollbarAnimationController
{
18 static scoped_ptr
<ScrollbarAnimationControllerLinearFade
> Create(
19 LayerImpl
* scroll_layer
,
20 base::TimeDelta fadeout_delay
,
21 base::TimeDelta fadeout_length
);
23 virtual ~ScrollbarAnimationControllerLinearFade();
25 // ScrollbarAnimationController overrides.
26 virtual bool IsScrollGestureInProgress() const OVERRIDE
;
27 virtual bool IsAnimating() const OVERRIDE
;
28 virtual base::TimeDelta
DelayBeforeStart(base::TimeTicks now
) const OVERRIDE
;
30 virtual bool Animate(base::TimeTicks now
) OVERRIDE
;
31 virtual void DidScrollGestureBegin() OVERRIDE
;
32 virtual void DidScrollGestureEnd(base::TimeTicks now
) OVERRIDE
;
33 virtual void DidProgrammaticallyUpdateScroll(base::TimeTicks now
) OVERRIDE
;
36 ScrollbarAnimationControllerLinearFade(LayerImpl
* scroll_layer
,
37 base::TimeDelta fadeout_delay
,
38 base::TimeDelta fadeout_length
);
41 float OpacityAtTime(base::TimeTicks now
);
43 LayerImpl
* scroll_layer_
;
45 base::TimeTicks last_awaken_time_
;
46 bool scroll_gesture_in_progress_
;
48 base::TimeDelta fadeout_delay_
;
49 base::TimeDelta fadeout_length_
;
51 DISALLOW_COPY_AND_ASSIGN(ScrollbarAnimationControllerLinearFade
);
56 #endif // CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_LINEAR_FADE_H_