| 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 WebInputEventResult sendMousePointerEvent( | 30 WebInputEventResult sendMousePointerEvent( |
| 31 Node*, const AtomicString& type, | 31 Node*, const AtomicString& type, |
| 32 int clickCount, const PlatformMouseEvent&, | 32 int clickCount, const PlatformMouseEvent&, |
| 33 Node* relatedTarget, | 33 Node* relatedTarget, |
| 34 Node* lastNodeUnderMouse); | 34 Node* lastNodeUnderMouse); |
| 35 | 35 |
| 36 WebInputEventResult handleTouchEvents( | 36 WebInputEventResult handleTouchEvents( |
| 37 const PlatformTouchEvent&); | 37 const PlatformTouchEvent&); |
| 38 | 38 |
| 39 // Sends node transition events mouseout/leave/over/enter to the | 39 // Sends boundary events mouseout/leave/over/enter to the |
| 40 // corresponding targets. This function sends pointerout/leave/over/enter | 40 // corresponding targets. This function sends pointerout/leave/over/enter |
| 41 // only when isFrameBoundaryTransition is true which indicates the | 41 // only when isFrameBoundaryTransition is true which indicates the |
| 42 // transition is over the document boundary and not only the elements border | 42 // transition is over the document boundary and not only the elements border |
| 43 // inside the document. If isFrameBoundaryTransition is false, | 43 // inside the document. If isFrameBoundaryTransition is false, |
| 44 // then the event is a compatibility event like those created by touch | 44 // then the event is a compatibility event like those created by touch |
| 45 // and in that case the corresponding pointer events will be handled by | 45 // and in that case the corresponding pointer events will be handled by |
| 46 // sendTouchPointerEvent for example and there is no need to send pointer | 46 // sendTouchPointerEvent for example and there is no need to send pointer |
| 47 // transition events. Note that normal mouse events (e.g. mousemove/down/up) | 47 // boundary events. Note that normal mouse events (e.g. mousemove/down/up) |
| 48 // and their corresponding transition events will be handled altogether by | 48 // and their corresponding boundary events will be handled altogether by |
| 49 // sendMousePointerEvent function. | 49 // sendMousePointerEvent function. |
| 50 void sendMouseAndPossiblyPointerNodeTransitionEvents( | 50 void sendMouseAndPossiblyPointerBoundaryEvents( |
| 51 Node* exitedNode, | 51 Node* exitedNode, |
| 52 Node* enteredNode, | 52 Node* enteredNode, |
| 53 const PlatformMouseEvent&, | 53 const PlatformMouseEvent&, |
| 54 bool isFrameBoundaryTransition); | 54 bool isFrameBoundaryTransition); |
| 55 | 55 |
| 56 // Resets the internal state of this object. | 56 // Resets the internal state of this object. |
| 57 void clear(); | 57 void clear(); |
| 58 | 58 |
| 59 void elementRemoved(EventTarget*); | 59 void elementRemoved(EventTarget*); |
| 60 void setPointerCapture(int, EventTarget*); | 60 void setPointerCapture(int, EventTarget*); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 // Sends touch pointer events and sets consumed bits in TouchInfo array | 97 // Sends touch pointer events and sets consumed bits in TouchInfo array |
| 98 // based on the return value of pointer event handlers. | 98 // based on the return value of pointer event handlers. |
| 99 void dispatchTouchPointerEvents( | 99 void dispatchTouchPointerEvents( |
| 100 const PlatformTouchEvent&, | 100 const PlatformTouchEvent&, |
| 101 HeapVector<TouchEventManager::TouchInfo>&); | 101 HeapVector<TouchEventManager::TouchInfo>&); |
| 102 | 102 |
| 103 // Returns whether the event is consumed or not. | 103 // Returns whether the event is consumed or not. |
| 104 WebInputEventResult sendTouchPointerEvent(EventTarget*, PointerEvent*); | 104 WebInputEventResult sendTouchPointerEvent(EventTarget*, PointerEvent*); |
| 105 | 105 |
| 106 void sendNodeTransitionEvents( | 106 void sendBoundaryEvents( |
| 107 EventTarget* exitedTarget, | 107 EventTarget* exitedTarget, |
| 108 EventTarget* enteredTarget, | 108 EventTarget* enteredTarget, |
| 109 PointerEvent*, | 109 PointerEvent*, |
| 110 const PlatformMouseEvent& = PlatformMouseEvent(), | 110 const PlatformMouseEvent& = PlatformMouseEvent(), |
| 111 bool sendMouseEvent = false); | 111 bool sendMouseEvent = false); |
| 112 void setNodeUnderPointer(PointerEvent*, | 112 void setNodeUnderPointer(PointerEvent*, |
| 113 EventTarget*, bool sendEvent = true); | 113 EventTarget*, bool sendEvent = true); |
| 114 | 114 |
| 115 // Returns whether the pointer capture is changed. In this case this | 115 // Processes the assignment of |m_pointerCaptureTarget| from |m_pendingPoint
erCaptureTarget| |
| 116 // function will take care of transition events and setNodeUnderPointer | 116 // and sends the got/lostpointercapture events, as per the spec: |
| 117 // should not send transition events. | 117 // https://w3c.github.io/pointerevents/#process-pending-pointer-capture |
| 118 // Returns whether the pointer capture is changed. When pointer capture is c
hanged, |
| 119 // this function will take care of boundary events. |
| 118 bool processPendingPointerCapture( | 120 bool processPendingPointerCapture( |
| 119 PointerEvent*, | 121 PointerEvent*, |
| 120 EventTarget*, | 122 EventTarget*, |
| 121 const PlatformMouseEvent& = PlatformMouseEvent(), | 123 const PlatformMouseEvent& = PlatformMouseEvent(), |
| 122 bool sendMouseEvent = false); | 124 bool sendMouseEvent = false); |
| 123 | 125 |
| 124 // Processes the capture state of a pointer, updates node under | 126 // Processes the capture state of a pointer, updates node under |
| 125 // pointer, and sends corresponding transition events for pointer if | 127 // pointer, and sends corresponding boundary events for pointer if |
| 126 // setPointerPosition is true. It also sends corresponding transition events | 128 // setPointerPosition is true. It also sends corresponding boundary events |
| 127 // for mouse if sendMouseEvent is true. | 129 // for mouse if sendMouseEvent is true. |
| 128 void processCaptureAndPositionOfPointerEvent( | 130 void processCaptureAndPositionOfPointerEvent( |
| 129 PointerEvent*, | 131 PointerEvent*, |
| 130 EventTarget* hitTestTarget, | 132 EventTarget* hitTestTarget, |
| 131 EventTarget* lastNodeUnderMouse = nullptr, | 133 EventTarget* lastNodeUnderMouse = nullptr, |
| 132 const PlatformMouseEvent& = PlatformMouseEvent(), | 134 const PlatformMouseEvent& = PlatformMouseEvent(), |
| 133 bool sendMouseEvent = false, | 135 bool sendMouseEvent = false, |
| 134 bool setPointerPosition = true); | 136 bool setPointerPosition = true); |
| 135 | 137 |
| 136 void removeTargetFromPointerCapturingMapping( | 138 void removeTargetFromPointerCapturingMapping( |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 PointerCapturingMap m_pointerCaptureTarget; | 172 PointerCapturingMap m_pointerCaptureTarget; |
| 171 PointerCapturingMap m_pendingPointerCaptureTarget; | 173 PointerCapturingMap m_pendingPointerCaptureTarget; |
| 172 PointerEventFactory m_pointerEventFactory; | 174 PointerEventFactory m_pointerEventFactory; |
| 173 TouchEventManager m_touchEventManager; | 175 TouchEventManager m_touchEventManager; |
| 174 | 176 |
| 175 }; | 177 }; |
| 176 | 178 |
| 177 } // namespace blink | 179 } // namespace blink |
| 178 | 180 |
| 179 #endif // PointerEventManager_h | 181 #endif // PointerEventManager_h |
| OLD | NEW |