Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ScrollManager_h | 5 #ifndef ScrollManager_h |
| 6 #define ScrollManager_h | 6 #define ScrollManager_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/page/EventWithHitTestResults.h" | 9 #include "core/page/EventWithHitTestResults.h" |
| 10 #include "platform/geometry/LayoutSize.h" | 10 #include "platform/geometry/LayoutSize.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 void resize(const WebMouseEvent&); | 88 void resize(const WebMouseEvent&); |
| 89 // Clears |m_resizeScrollableArea|. if |shouldNotBeNull| is true this | 89 // Clears |m_resizeScrollableArea|. if |shouldNotBeNull| is true this |
| 90 // function DCHECKs to make sure that variable is indeed not null. | 90 // function DCHECKs to make sure that variable is indeed not null. |
| 91 void clearResizeScrollableArea(bool shouldNotBeNull); | 91 void clearResizeScrollableArea(bool shouldNotBeNull); |
| 92 void setResizeScrollableArea(PaintLayer*, IntPoint); | 92 void setResizeScrollableArea(PaintLayer*, IntPoint); |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 WebInputEventResult handleGestureScrollUpdate(const WebGestureEvent&); | 95 WebInputEventResult handleGestureScrollUpdate(const WebGestureEvent&); |
| 96 WebInputEventResult handleGestureScrollBegin(const WebGestureEvent&); | 96 WebInputEventResult handleGestureScrollBegin(const WebGestureEvent&); |
| 97 | 97 |
| 98 WebInputEventResult passScrollGestureEventToWidget(const WebGestureEvent&, | 98 WebInputEventResult passScrollGestureEventToFrameViewBase( |
|
haraken
2017/03/08 06:19:06
Maybe we could drop "ToFrameViewBase" to make it l
joelhockey
2017/03/08 06:42:36
Done. Yes, the parameters make it clear enought t
| |
| 99 LayoutObject*); | 99 const WebGestureEvent&, |
| 100 LayoutObject*); | |
| 100 | 101 |
| 101 void clearGestureScrollState(); | 102 void clearGestureScrollState(); |
| 102 | 103 |
| 103 void customizedScroll(const Node& startNode, ScrollState&); | 104 void customizedScroll(const Node& startNode, ScrollState&); |
| 104 | 105 |
| 105 FrameHost* frameHost() const; | 106 FrameHost* frameHost() const; |
| 106 | 107 |
| 107 bool isViewportScrollingElement(const Element&) const; | 108 bool isViewportScrollingElement(const Element&) const; |
| 108 | 109 |
| 109 bool handleScrollGestureOnResizer(Node*, const WebGestureEvent&); | 110 bool handleScrollGestureOnResizer(Node*, const WebGestureEvent&); |
| 110 | 111 |
| 111 void recomputeScrollChain(const Node& startNode, | 112 void recomputeScrollChain(const Node& startNode, |
| 112 std::deque<int>& scrollChain); | 113 std::deque<int>& scrollChain); |
| 113 | 114 |
| 114 // NOTE: If adding a new field to this class please ensure that it is | 115 // NOTE: If adding a new field to this class please ensure that it is |
| 115 // cleared in |ScrollManager::clear()|. | 116 // cleared in |ScrollManager::clear()|. |
| 116 | 117 |
| 117 const Member<LocalFrame> m_frame; | 118 const Member<LocalFrame> m_frame; |
| 118 | 119 |
| 119 // Only used with the ScrollCustomization runtime enabled feature. | 120 // Only used with the ScrollCustomization runtime enabled feature. |
| 120 std::deque<int> m_currentScrollChain; | 121 std::deque<int> m_currentScrollChain; |
| 121 | 122 |
| 122 Member<Node> m_scrollGestureHandlingNode; | 123 Member<Node> m_scrollGestureHandlingNode; |
| 123 | 124 |
| 124 bool m_lastGestureScrollOverWidget; | 125 bool m_lastGestureScrollOverFrameViewBase; |
|
haraken
2017/03/08 06:19:06
Maybe drop "OverFrameViewBase".
joelhockey
2017/03/08 06:42:36
I'll leave this for now. I did think about making
| |
| 125 | 126 |
| 126 // The most recent element to scroll natively during this scroll | 127 // The most recent element to scroll natively during this scroll |
| 127 // sequence. Null if no native element has scrolled this scroll | 128 // sequence. Null if no native element has scrolled this scroll |
| 128 // sequence, or if the most recent element to scroll used scroll | 129 // sequence, or if the most recent element to scroll used scroll |
| 129 // customization. | 130 // customization. |
| 130 Member<Element> m_previousGestureScrolledElement; | 131 Member<Element> m_previousGestureScrolledElement; |
| 131 | 132 |
| 132 // True iff some of the delta has been consumed for the current | 133 // True iff some of the delta has been consumed for the current |
| 133 // scroll sequence in this frame, or any child frames. Only used | 134 // scroll sequence in this frame, or any child frames. Only used |
| 134 // with ScrollCustomization. If some delta has been consumed, a | 135 // with ScrollCustomization. If some delta has been consumed, a |
| 135 // scroll which shouldn't propagate can't cause any element to | 136 // scroll which shouldn't propagate can't cause any element to |
| 136 // scroll other than the |m_previousGestureScrolledNode|. | 137 // scroll other than the |m_previousGestureScrolledNode|. |
| 137 bool m_deltaConsumedForScrollSequence; | 138 bool m_deltaConsumedForScrollSequence; |
| 138 | 139 |
| 139 Member<Scrollbar> m_scrollbarHandlingScrollGesture; | 140 Member<Scrollbar> m_scrollbarHandlingScrollGesture; |
| 140 | 141 |
| 141 Member<PaintLayerScrollableArea> m_resizeScrollableArea; | 142 Member<PaintLayerScrollableArea> m_resizeScrollableArea; |
| 142 | 143 |
| 143 LayoutSize | 144 LayoutSize |
| 144 m_offsetFromResizeCorner; // In the coords of m_resizeScrollableArea. | 145 m_offsetFromResizeCorner; // In the coords of m_resizeScrollableArea. |
| 145 }; | 146 }; |
| 146 | 147 |
| 147 } // namespace blink | 148 } // namespace blink |
| 148 | 149 |
| 149 #endif // ScrollManager_h | 150 #endif // ScrollManager_h |
| OLD | NEW |