add a use_alsa gyp setting
[chromium-blink-merge.git] / cc / scrollbar_animation_controller_linear_fade.h
blob5bcfc650fc00f53176b742a67340459130f3c4ae
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"
12 namespace cc {
13 class LayerImpl;
15 class CC_EXPORT ScrollbarAnimationControllerLinearFade : public ScrollbarAnimationController {
16 public:
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;
27 protected:
28 ScrollbarAnimationControllerLinearFade(LayerImpl* scrollLayer, double fadeoutDelay, double fadeoutLength);
30 private:
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;
44 } // namespace cc
46 #endif // CC_SCROLLBAR_ANIMATION_CONTROLLER_LINEAR_FADE_H_