OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010, 2011 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 12 matching lines...) Expand all Loading... |
23 * THE POSSIBILITY OF SUCH DAMAGE. | 23 * THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef ScrollAnimatorMac_h | 26 #ifndef ScrollAnimatorMac_h |
27 #define ScrollAnimatorMac_h | 27 #define ScrollAnimatorMac_h |
28 | 28 |
29 #include "platform/Timer.h" | 29 #include "platform/Timer.h" |
30 #include "platform/geometry/FloatPoint.h" | 30 #include "platform/geometry/FloatPoint.h" |
31 #include "platform/geometry/FloatSize.h" | 31 #include "platform/geometry/FloatSize.h" |
32 #include "platform/geometry/IntRect.h" | 32 #include "platform/geometry/IntRect.h" |
| 33 #include "platform/heap/Handle.h" |
33 #include "platform/scroll/ScrollAnimatorBase.h" | 34 #include "platform/scroll/ScrollAnimatorBase.h" |
34 #include "wtf/RetainPtr.h" | 35 #include "wtf/RetainPtr.h" |
35 | 36 |
36 OBJC_CLASS WebScrollAnimationHelperDelegate; | 37 OBJC_CLASS WebScrollAnimationHelperDelegate; |
37 OBJC_CLASS WebScrollbarPainterControllerDelegate; | 38 OBJC_CLASS WebScrollbarPainterControllerDelegate; |
38 OBJC_CLASS WebScrollbarPainterDelegate; | 39 OBJC_CLASS WebScrollbarPainterDelegate; |
39 | 40 |
40 typedef id ScrollbarPainterController; | 41 typedef id ScrollbarPainterController; |
41 | 42 |
42 namespace blink { | 43 namespace blink { |
43 | 44 |
44 class Scrollbar; | 45 class Scrollbar; |
45 | 46 |
46 class PLATFORM_EXPORT ScrollAnimatorMac : public ScrollAnimatorBase { | 47 class PLATFORM_EXPORT ScrollAnimatorMac : public ScrollAnimatorBase { |
47 | |
48 public: | 48 public: |
49 ScrollAnimatorMac(ScrollableArea*); | 49 ScrollAnimatorMac(ScrollableArea*); |
50 ~ScrollAnimatorMac() override; | 50 ~ScrollAnimatorMac() override; |
51 | 51 |
| 52 void cleanup() override; |
| 53 |
52 void immediateScrollToPointForScrollAnimation(const FloatPoint& newPosition)
; | 54 void immediateScrollToPointForScrollAnimation(const FloatPoint& newPosition)
; |
53 bool haveScrolledSincePageLoad() const { return m_haveScrolledSincePageLoad;
} | 55 bool haveScrolledSincePageLoad() const { return m_haveScrolledSincePageLoad;
} |
54 | 56 |
55 void updateScrollerStyle(); | 57 void updateScrollerStyle(); |
56 | 58 |
57 bool scrollbarPaintTimerIsActive() const; | 59 bool scrollbarPaintTimerIsActive() const; |
58 void startScrollbarPaintTimer(); | 60 void startScrollbarPaintTimer(); |
59 void stopScrollbarPaintTimer(); | 61 void stopScrollbarPaintTimer(); |
60 | 62 |
61 void sendContentAreaScrolledSoon(const FloatSize& scrollDelta); | 63 void sendContentAreaScrolledSoon(const FloatSize& scrollDelta); |
62 | 64 |
63 void setVisibleScrollerThumbRect(const IntRect&); | 65 void setVisibleScrollerThumbRect(const IntRect&); |
64 | 66 |
65 static bool canUseCoordinatedScrollbar(); | 67 static bool canUseCoordinatedScrollbar(); |
66 | 68 |
| 69 DEFINE_INLINE_VIRTUAL_TRACE() |
| 70 { |
| 71 ScrollAnimatorBase::trace(visitor); |
| 72 } |
| 73 |
67 private: | 74 private: |
68 RetainPtr<id> m_scrollAnimationHelper; | 75 RetainPtr<id> m_scrollAnimationHelper; |
69 RetainPtr<WebScrollAnimationHelperDelegate> m_scrollAnimationHelperDelegate; | 76 RetainPtr<WebScrollAnimationHelperDelegate> m_scrollAnimationHelperDelegate; |
70 | 77 |
71 RetainPtr<ScrollbarPainterController> m_scrollbarPainterController; | 78 RetainPtr<ScrollbarPainterController> m_scrollbarPainterController; |
72 RetainPtr<WebScrollbarPainterControllerDelegate> m_scrollbarPainterControlle
rDelegate; | 79 RetainPtr<WebScrollbarPainterControllerDelegate> m_scrollbarPainterControlle
rDelegate; |
73 RetainPtr<WebScrollbarPainterDelegate> m_horizontalScrollbarPainterDelegate; | 80 RetainPtr<WebScrollbarPainterDelegate> m_horizontalScrollbarPainterDelegate; |
74 RetainPtr<WebScrollbarPainterDelegate> m_verticalScrollbarPainterDelegate; | 81 RetainPtr<WebScrollbarPainterDelegate> m_verticalScrollbarPainterDelegate; |
75 | 82 |
76 void initialScrollbarPaintTimerFired(Timer<ScrollAnimatorMac>*); | 83 void initialScrollbarPaintTimerFired(Timer<ScrollAnimatorMac>*); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 void immediateScrollTo(const FloatPoint&); | 128 void immediateScrollTo(const FloatPoint&); |
122 | 129 |
123 bool m_haveScrolledSincePageLoad; | 130 bool m_haveScrolledSincePageLoad; |
124 bool m_needsScrollerStyleUpdate; | 131 bool m_needsScrollerStyleUpdate; |
125 IntRect m_visibleScrollerThumbRect; | 132 IntRect m_visibleScrollerThumbRect; |
126 }; | 133 }; |
127 | 134 |
128 } // namespace blink | 135 } // namespace blink |
129 | 136 |
130 #endif // ScrollAnimatorMac_h | 137 #endif // ScrollAnimatorMac_h |
OLD | NEW |