OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011, Google Inc. All rights reserved. | 2 * Copyright (c) 2011, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 #include "platform/Timer.h" | 34 #include "platform/Timer.h" |
35 #include "platform/geometry/FloatPoint.h" | 35 #include "platform/geometry/FloatPoint.h" |
36 #include "platform/scroll/ScrollAnimatorBase.h" | 36 #include "platform/scroll/ScrollAnimatorBase.h" |
37 #include "public/platform/WebScrollOffsetAnimationCurve.h" | 37 #include "public/platform/WebScrollOffsetAnimationCurve.h" |
38 | 38 |
39 namespace blink { | 39 namespace blink { |
40 | 40 |
41 class ScrollAnimatorTest; | 41 class ScrollAnimatorTest; |
42 | 42 |
43 class PLATFORM_EXPORT ScrollAnimator : public ScrollAnimatorBase { | 43 class PLATFORM_EXPORT ScrollAnimator final : public ScrollAnimatorBase { |
44 public: | 44 public: |
45 explicit ScrollAnimator(ScrollableArea*, WTF::TimeFunction = WTF::monotonica
llyIncreasingTime); | 45 explicit ScrollAnimator(ScrollableArea*, WTF::TimeFunction = WTF::monotonica
llyIncreasingTime); |
46 ~ScrollAnimator() override; | 46 ~ScrollAnimator() override; |
47 | 47 |
48 ScrollResultOneDimensional userScroll(ScrollbarOrientation, ScrollGranularit
y, float step, float delta) override; | 48 ScrollResultOneDimensional userScroll(ScrollbarOrientation, ScrollGranularit
y, float step, float delta) override; |
49 void scrollToOffsetWithoutAnimation(const FloatPoint&) override; | 49 void scrollToOffsetWithoutAnimation(const FloatPoint&) override; |
50 | 50 |
51 void cancelAnimations() override; | 51 void cancelAnimations() override; |
52 void serviceScrollAnimations() override; | 52 void serviceScrollAnimations() override; |
53 bool hasRunningAnimation() const override; | 53 bool hasRunningAnimation() const override; |
54 | 54 |
| 55 DECLARE_VIRTUAL_TRACE(); |
| 56 |
55 protected: | 57 protected: |
56 void animationTimerFired(); | 58 void animationTimerFired(); |
57 | 59 |
58 OwnPtr<WebScrollOffsetAnimationCurve> m_animationCurve; | 60 OwnPtr<WebScrollOffsetAnimationCurve> m_animationCurve; |
59 double m_startTime; | 61 double m_startTime; |
60 WTF::TimeFunction m_timeFunction; | 62 WTF::TimeFunction m_timeFunction; |
61 }; | 63 }; |
62 | 64 |
63 } // namespace blink | 65 } // namespace blink |
64 | 66 |
65 #endif // ScrollAnimator_h | 67 #endif // ScrollAnimator_h |
OLD | NEW |