| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // and sends the got/lostpointercapture events, as per the spec: | 121 // and sends the got/lostpointercapture events, as per the spec: |
| 122 // https://w3c.github.io/pointerevents/#process-pending-pointer-capture | 122 // https://w3c.github.io/pointerevents/#process-pending-pointer-capture |
| 123 // Returns whether the pointer capture is changed. When pointer capture is c
hanged, | 123 // Returns whether the pointer capture is changed. When pointer capture is c
hanged, |
| 124 // this function will take care of boundary events. | 124 // this function will take care of boundary events. |
| 125 bool processPendingPointerCapture( | 125 bool processPendingPointerCapture( |
| 126 PointerEvent*, | 126 PointerEvent*, |
| 127 EventTarget*, | 127 EventTarget*, |
| 128 const PlatformMouseEvent& = PlatformMouseEvent(), | 128 const PlatformMouseEvent& = PlatformMouseEvent(), |
| 129 bool sendMouseEvent = false); | 129 bool sendMouseEvent = false); |
| 130 | 130 |
| 131 // Try to immediately send the got/lostpointercapture without boundary |
| 132 // events. |
| 133 void immediateProcessPendingPointerCapture(int pointerId); |
| 134 |
| 131 // Processes the capture state of a pointer, updates node under | 135 // Processes the capture state of a pointer, updates node under |
| 132 // pointer, and sends corresponding boundary events for pointer if | 136 // pointer, and sends corresponding boundary events for pointer if |
| 133 // setPointerPosition is true. It also sends corresponding boundary events | 137 // setPointerPosition is true. It also sends corresponding boundary events |
| 134 // for mouse if sendMouseEvent is true. | 138 // for mouse if sendMouseEvent is true. |
| 135 void processCaptureAndPositionOfPointerEvent( | 139 void processCaptureAndPositionOfPointerEvent( |
| 136 PointerEvent*, | 140 PointerEvent*, |
| 137 EventTarget* hitTestTarget, | 141 EventTarget* hitTestTarget, |
| 138 EventTarget* lastNodeUnderMouse = nullptr, | 142 EventTarget* lastNodeUnderMouse = nullptr, |
| 139 const PlatformMouseEvent& = PlatformMouseEvent(), | 143 const PlatformMouseEvent& = PlatformMouseEvent(), |
| 140 bool sendMouseEvent = false, | 144 bool sendMouseEvent = false, |
| 141 bool setPointerPosition = true); | 145 bool setPointerPosition = true); |
| 142 | 146 |
| 143 void removeTargetFromPointerCapturingMapping( | 147 void removeTargetFromPointerCapturingMapping( |
| 144 PointerCapturingMap&, const EventTarget*); | 148 PointerCapturingMap&, const EventTarget*); |
| 145 EventTarget* getEffectiveTargetForPointerEvent( | 149 EventTarget* getEffectiveTargetForPointerEvent( |
| 146 EventTarget*, int); | 150 EventTarget*, int); |
| 147 EventTarget* getCapturingNode(int); | 151 EventTarget* getCapturingNode(int); |
| 148 void removePointer(PointerEvent*); | 152 void removePointer(PointerEvent*); |
| 149 WebInputEventResult dispatchPointerEvent( | 153 WebInputEventResult dispatchPointerEvent( |
| 150 EventTarget*, | 154 EventTarget*, |
| 151 PointerEvent*, | 155 PointerEvent*, |
| 152 bool checkForListener = false); | 156 bool checkForListener = false); |
| 153 void releasePointerCapture(int); | 157 void releasePointerCapture(int); |
| 158 // Returns true if capture target and pending capture target were different. |
| 159 bool getPointerCaptureState(int pointerId, |
| 160 EventTarget** pointerCaptureTarget, |
| 161 EventTarget** pendingPointerCaptureTarget); |
| 154 | 162 |
| 155 // NOTE: If adding a new field to this class please ensure that it is | 163 // NOTE: If adding a new field to this class please ensure that it is |
| 156 // cleared in |PointerEventManager::clear()|. | 164 // cleared in |PointerEventManager::clear()|. |
| 157 | 165 |
| 158 const Member<LocalFrame> m_frame; | 166 const Member<LocalFrame> m_frame; |
| 159 | 167 |
| 160 // Prevents firing mousedown, mousemove & mouseup in-between a canceled poin
terdown and next pointerup/pointercancel. | 168 // Prevents firing mousedown, mousemove & mouseup in-between a canceled poin
terdown and next pointerup/pointercancel. |
| 161 // See "PREVENT MOUSE EVENT flag" in the spec: | 169 // See "PREVENT MOUSE EVENT flag" in the spec: |
| 162 // https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-e
vents | 170 // https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-e
vents |
| 163 bool m_preventMouseEventForPointerType[static_cast<size_t>(WebPointerPropert
ies::PointerType::LastEntry) + 1]; | 171 bool m_preventMouseEventForPointerType[static_cast<size_t>(WebPointerPropert
ies::PointerType::LastEntry) + 1]; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 179 PointerCapturingMap m_pointerCaptureTarget; | 187 PointerCapturingMap m_pointerCaptureTarget; |
| 180 PointerCapturingMap m_pendingPointerCaptureTarget; | 188 PointerCapturingMap m_pendingPointerCaptureTarget; |
| 181 | 189 |
| 182 PointerEventFactory m_pointerEventFactory; | 190 PointerEventFactory m_pointerEventFactory; |
| 183 TouchEventManager m_touchEventManager; | 191 TouchEventManager m_touchEventManager; |
| 184 }; | 192 }; |
| 185 | 193 |
| 186 } // namespace blink | 194 } // namespace blink |
| 187 | 195 |
| 188 #endif // PointerEventManager_h | 196 #endif // PointerEventManager_h |
| OLD | NEW |