OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 virtual void setIsActive() { } | 66 virtual void setIsActive() { } |
67 | 67 |
68 #if OS(MACOSX) | 68 #if OS(MACOSX) |
69 virtual void handleWheelEventPhase(PlatformWheelEventPhase) { } | 69 virtual void handleWheelEventPhase(PlatformWheelEventPhase) { } |
70 #endif | 70 #endif |
71 | 71 |
72 void setCurrentPosition(const FloatPoint&); | 72 void setCurrentPosition(const FloatPoint&); |
73 FloatPoint currentPosition() const; | 73 FloatPoint currentPosition() const; |
74 | 74 |
| 75 // Returns how much of pixelDelta will be used by the underlying scrollable |
| 76 // area. |
| 77 virtual float computeDeltaToConsume(ScrollbarOrientation, float pixelDelta)
const; |
| 78 |
75 virtual void cancelAnimations() { } | 79 virtual void cancelAnimations() { } |
76 virtual void serviceScrollAnimations() { } | 80 virtual void serviceScrollAnimations() { } |
77 virtual bool hasRunningAnimation() const { return false; } | 81 virtual bool hasRunningAnimation() const { return false; } |
78 | 82 |
79 virtual void contentAreaWillPaint() const { } | 83 virtual void contentAreaWillPaint() const { } |
80 virtual void mouseEnteredContentArea() const { } | 84 virtual void mouseEnteredContentArea() const { } |
81 virtual void mouseExitedContentArea() const { } | 85 virtual void mouseExitedContentArea() const { } |
82 virtual void mouseMovedInContentArea() const { } | 86 virtual void mouseMovedInContentArea() const { } |
83 virtual void mouseEnteredScrollbar(Scrollbar&) const { } | 87 virtual void mouseEnteredScrollbar(Scrollbar&) const { } |
84 virtual void mouseExitedScrollbar(Scrollbar&) const { } | 88 virtual void mouseExitedScrollbar(Scrollbar&) const { } |
(...skipping 17 matching lines...) Expand all Loading... |
102 | 106 |
103 virtual bool setScrollbarsVisibleForTesting(bool) { return false; } | 107 virtual bool setScrollbarsVisibleForTesting(bool) { return false; } |
104 | 108 |
105 DECLARE_VIRTUAL_TRACE(); | 109 DECLARE_VIRTUAL_TRACE(); |
106 | 110 |
107 protected: | 111 protected: |
108 explicit ScrollAnimatorBase(ScrollableArea*); | 112 explicit ScrollAnimatorBase(ScrollableArea*); |
109 | 113 |
110 virtual void notifyPositionChanged(); | 114 virtual void notifyPositionChanged(); |
111 | 115 |
| 116 float clampScrollPosition(ScrollbarOrientation, float) const; |
| 117 |
112 RawPtrWillBeMember<ScrollableArea> m_scrollableArea; | 118 RawPtrWillBeMember<ScrollableArea> m_scrollableArea; |
113 float m_currentPosX; // We avoid using a FloatPoint in order to reduce | 119 float m_currentPosX; // We avoid using a FloatPoint in order to reduce |
114 float m_currentPosY; // subclass code complexity. | 120 float m_currentPosY; // subclass code complexity. |
115 | |
116 private: | |
117 float clampScrollPosition(ScrollbarOrientation, float); | |
118 }; | 121 }; |
119 | 122 |
120 } // namespace blink | 123 } // namespace blink |
121 | 124 |
122 #endif // ScrollAnimatorBase_h | 125 #endif // ScrollAnimatorBase_h |
OLD | NEW |