summaryrefslogtreecommitdiffstats
path: root/cc/animation/scrollbar_animation_controller_linear_fade.h
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-18 07:09:09 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-18 07:09:09 +0000
commit95e4e1a0fda6929b47702e69e4ddfe384b5d014b (patch)
tree1cf6fc6d2d063aac4a14388de969a5214e2e9243 /cc/animation/scrollbar_animation_controller_linear_fade.h
parenta2f3755a9e22ced917b1dda50c57e4e912594e9d (diff)
downloadchromium_src-95e4e1a0fda6929b47702e69e4ddfe384b5d014b.zip
chromium_src-95e4e1a0fda6929b47702e69e4ddfe384b5d014b.tar.gz
chromium_src-95e4e1a0fda6929b47702e69e4ddfe384b5d014b.tar.bz2
Part 3 of cc/ directory shuffles: animation
Continuation of https://src.chromium.org/viewvc/chrome?view=rev&revision=188681 BUG=190824 TBR=enne@chromium.org, vollick@chromium.org Review URL: https://codereview.chromium.org/12822004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188688 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/animation/scrollbar_animation_controller_linear_fade.h')
-rw-r--r--cc/animation/scrollbar_animation_controller_linear_fade.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/cc/animation/scrollbar_animation_controller_linear_fade.h b/cc/animation/scrollbar_animation_controller_linear_fade.h
new file mode 100644
index 0000000..a126306
--- /dev/null
+++ b/cc/animation/scrollbar_animation_controller_linear_fade.h
@@ -0,0 +1,50 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_LINEAR_FADE_H_
+#define CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_LINEAR_FADE_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "cc/animation/scrollbar_animation_controller.h"
+#include "cc/base/cc_export.h"
+
+namespace cc {
+class LayerImpl;
+
+class CC_EXPORT ScrollbarAnimationControllerLinearFade : public ScrollbarAnimationController {
+public:
+ static scoped_ptr<ScrollbarAnimationControllerLinearFade> create(LayerImpl* scrollLayer, base::TimeDelta fadeoutDelay, base::TimeDelta fadeoutLength);
+
+ virtual ~ScrollbarAnimationControllerLinearFade();
+
+ // ScrollbarAnimationController overrides.
+ virtual bool isScrollGestureInProgress() const OVERRIDE;
+ virtual bool isAnimating() const OVERRIDE;
+ virtual base::TimeDelta delayBeforeStart(base::TimeTicks now) const OVERRIDE;
+
+ virtual bool animate(base::TimeTicks) OVERRIDE;
+ virtual void didScrollGestureBegin() OVERRIDE;
+ virtual void didScrollGestureEnd(base::TimeTicks now) OVERRIDE;
+ virtual void didProgrammaticallyUpdateScroll(base::TimeTicks now) OVERRIDE;
+
+protected:
+ ScrollbarAnimationControllerLinearFade(LayerImpl* scrollLayer, base::TimeDelta fadeoutDelay, base::TimeDelta fadeoutLength);
+
+private:
+ float opacityAtTime(base::TimeTicks);
+
+ LayerImpl* m_scrollLayer;
+
+ base::TimeTicks m_lastAwakenTime;
+ bool m_scrollGestureInProgress;
+
+ base::TimeDelta m_fadeoutDelay;
+ base::TimeDelta m_fadeoutLength;
+
+ double m_currentTimeForTesting;
+};
+
+} // namespace cc
+
+#endif // CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_LINEAR_FADE_H_