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 PointerEventManager_h | 5 #ifndef PointerEventManager_h |
6 #define PointerEventManager_h | 6 #define PointerEventManager_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/events/PointerEvent.h" | 9 #include "core/events/PointerEvent.h" |
10 #include "core/events/PointerEventFactory.h" | 10 #include "core/events/PointerEventFactory.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // Inhibits firing of touch-type PointerEvents until unblocked by | 129 // Inhibits firing of touch-type PointerEvents until unblocked by |
130 // unblockTouchPointers(). Also sends pointercancels for existing touch-type | 130 // unblockTouchPointers(). Also sends pointercancels for existing touch-type |
131 // PointerEvents. See: | 131 // PointerEvents. See: |
132 // www.w3.org/TR/pointerevents/#declaring-candidate-regions-for-default-touch-
behaviors | 132 // www.w3.org/TR/pointerevents/#declaring-candidate-regions-for-default-touch-
behaviors |
133 void blockTouchPointers(); | 133 void blockTouchPointers(); |
134 | 134 |
135 // Enables firing of touch-type PointerEvents after they were inhibited by | 135 // Enables firing of touch-type PointerEvents after they were inhibited by |
136 // blockTouchPointers(). | 136 // blockTouchPointers(). |
137 void unblockTouchPointers(); | 137 void unblockTouchPointers(); |
138 | 138 |
| 139 // Generate the TouchInfos for a PlatformTouchEvent, hit-testing as necessary. |
| 140 void computeTouchTargets(const PlatformTouchEvent&, |
| 141 HeapVector<TouchEventManager::TouchInfo>&); |
| 142 |
139 // Sends touch pointer events and sets consumed bits in TouchInfo array | 143 // Sends touch pointer events and sets consumed bits in TouchInfo array |
140 // based on the return value of pointer event handlers. | 144 // based on the return value of pointer event handlers. |
141 void dispatchTouchPointerEvents(const PlatformTouchEvent&, | 145 void dispatchTouchPointerEvents(const PlatformTouchEvent&, |
142 HeapVector<TouchEventManager::TouchInfo>&); | 146 HeapVector<TouchEventManager::TouchInfo>&); |
143 | 147 |
144 // Returns whether the event is consumed or not. | 148 // Returns whether the event is consumed or not. |
145 WebInputEventResult sendTouchPointerEvent(EventTarget*, PointerEvent*); | 149 WebInputEventResult sendTouchPointerEvent(EventTarget*, PointerEvent*); |
146 | 150 |
147 void sendBoundaryEvents(EventTarget* exitedTarget, | 151 void sendBoundaryEvents(EventTarget* exitedTarget, |
148 EventTarget* enteredTarget, | 152 EventTarget* enteredTarget, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 189 |
186 const Member<LocalFrame> m_frame; | 190 const Member<LocalFrame> m_frame; |
187 | 191 |
188 // Prevents firing mousedown, mousemove & mouseup in-between a canceled | 192 // Prevents firing mousedown, mousemove & mouseup in-between a canceled |
189 // pointerdown and next pointerup/pointercancel. | 193 // pointerdown and next pointerup/pointercancel. |
190 // See "PREVENT MOUSE EVENT flag" in the spec: | 194 // See "PREVENT MOUSE EVENT flag" in the spec: |
191 // https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-eve
nts | 195 // https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-eve
nts |
192 bool m_preventMouseEventForPointerType | 196 bool m_preventMouseEventForPointerType |
193 [static_cast<size_t>(WebPointerProperties::PointerType::LastEntry) + 1]; | 197 [static_cast<size_t>(WebPointerProperties::PointerType::LastEntry) + 1]; |
194 | 198 |
195 // Set upon sending a pointercancel for touch, prevents PE dispatches for | 199 // Set upon TouchScrollStarted when sending a pointercancel, prevents PE |
196 // touches until all touch-points become inactive. | 200 // dispatches for touches until all touch-points become inactive. |
197 bool m_inCanceledStateForPointerTypeTouch; | 201 bool m_inCanceledStateForPointerTypeTouch; |
198 | 202 |
199 Deque<uint32_t> m_touchIdsForCanceledPointerdowns; | 203 Deque<uint32_t> m_touchIdsForCanceledPointerdowns; |
200 | 204 |
201 // Note that this map keeps track of node under pointer with id=1 as well | 205 // Note that this map keeps track of node under pointer with id=1 as well |
202 // which might be different than m_nodeUnderMouse in EventHandler. That one | 206 // which might be different than m_nodeUnderMouse in EventHandler. That one |
203 // keeps track of any compatibility mouse event positions but this map for | 207 // keeps track of any compatibility mouse event positions but this map for |
204 // the pointer with id=1 is only taking care of true mouse related events. | 208 // the pointer with id=1 is only taking care of true mouse related events. |
205 using NodeUnderPointerMap = | 209 using NodeUnderPointerMap = |
206 HeapHashMap<int, | 210 HeapHashMap<int, |
207 EventTargetAttributes, | 211 EventTargetAttributes, |
208 WTF::IntHash<int>, | 212 WTF::IntHash<int>, |
209 WTF::UnsignedWithZeroKeyHashTraits<int>>; | 213 WTF::UnsignedWithZeroKeyHashTraits<int>>; |
210 NodeUnderPointerMap m_nodeUnderPointer; | 214 NodeUnderPointerMap m_nodeUnderPointer; |
211 | 215 |
212 PointerCapturingMap m_pointerCaptureTarget; | 216 PointerCapturingMap m_pointerCaptureTarget; |
213 PointerCapturingMap m_pendingPointerCaptureTarget; | 217 PointerCapturingMap m_pendingPointerCaptureTarget; |
214 | 218 |
215 PointerEventFactory m_pointerEventFactory; | 219 PointerEventFactory m_pointerEventFactory; |
216 Member<TouchEventManager> m_touchEventManager; | 220 Member<TouchEventManager> m_touchEventManager; |
217 Member<MouseEventManager> m_mouseEventManager; | 221 Member<MouseEventManager> m_mouseEventManager; |
218 }; | 222 }; |
219 | 223 |
220 } // namespace blink | 224 } // namespace blink |
221 | 225 |
222 #endif // PointerEventManager_h | 226 #endif // PointerEventManager_h |
OLD | NEW |