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 15 matching lines...) Expand all Loading... |
26 WTF_MAKE_NONCOPYABLE(PointerEventManager); | 26 WTF_MAKE_NONCOPYABLE(PointerEventManager); |
27 public: | 27 public: |
28 explicit PointerEventManager(LocalFrame*, MouseEventManager*); | 28 explicit PointerEventManager(LocalFrame*, MouseEventManager*); |
29 DECLARE_TRACE(); | 29 DECLARE_TRACE(); |
30 | 30 |
31 // Sends the mouse pointer events and the boundary events | 31 // Sends the mouse pointer events and the boundary events |
32 // that it may cause. It also sends the compat mouse events | 32 // that it may cause. It also sends the compat mouse events |
33 // and sets the newNodeUnderMouse if the capturing is set | 33 // and sets the newNodeUnderMouse if the capturing is set |
34 // in this function. | 34 // in this function. |
35 WebInputEventResult sendMousePointerEvent( | 35 WebInputEventResult sendMousePointerEvent( |
36 Node* target, const AtomicString& type, | 36 Node* target, const AtomicString& type, const PlatformMouseEvent&); |
37 int clickCount, const PlatformMouseEvent&, | |
38 Node* lastNodeUnderMouse, | |
39 Node** newNodeUnderMouse); | |
40 | 37 |
41 WebInputEventResult handleTouchEvents( | 38 WebInputEventResult handleTouchEvents( |
42 const PlatformTouchEvent&); | 39 const PlatformTouchEvent&); |
43 | 40 |
44 // Sends boundary events mouseout/leave/over/enter to the | 41 // Sends boundary events pointerout/leave/over/enter and |
45 // corresponding targets. This function sends pointerout/leave/over/enter | 42 // mouseout/leave/over/enter to the corresponding targets. |
46 // only when isFrameBoundaryTransition is true which indicates the | 43 // inside the document. This functions handles the cases that pointer is |
47 // transition is over the document boundary and not only the elements border | 44 // leaving a frame. Note that normal mouse events (e.g. mousemove/down/up) |
48 // inside the document. If isFrameBoundaryTransition is false, | |
49 // then the event is a compatibility event like those created by touch | |
50 // and in that case the corresponding pointer events will be handled by | |
51 // sendTouchPointerEvent for example and there is no need to send pointer | |
52 // boundary events. Note that normal mouse events (e.g. mousemove/down/up) | |
53 // and their corresponding boundary events will be handled altogether by | 45 // and their corresponding boundary events will be handled altogether by |
54 // sendMousePointerEvent function. | 46 // sendMousePointerEvent function. |
55 void sendMouseAndPossiblyPointerBoundaryEvents( | 47 void sendMouseAndPointerBoundaryEvents( |
56 Node* exitedNode, | |
57 Node* enteredNode, | 48 Node* enteredNode, |
58 const PlatformMouseEvent&, | 49 const PlatformMouseEvent&); |
59 bool isFrameBoundaryTransition); | |
60 | 50 |
61 // Resets the internal state of this object. | 51 // Resets the internal state of this object. |
62 void clear(); | 52 void clear(); |
63 | 53 |
64 void elementRemoved(EventTarget*); | 54 void elementRemoved(EventTarget*); |
65 | 55 |
66 void setPointerCapture(int, EventTarget*); | 56 void setPointerCapture(int, EventTarget*); |
67 void releasePointerCapture(int, EventTarget*); | 57 void releasePointerCapture(int, EventTarget*); |
68 | 58 |
69 // See Element::hasPointerCapture(int). | 59 // See Element::hasPointerCapture(int). |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 void processPendingPointerCapture(PointerEvent*); | 146 void processPendingPointerCapture(PointerEvent*); |
157 | 147 |
158 // Processes the capture state of a pointer, updates node under | 148 // Processes the capture state of a pointer, updates node under |
159 // pointer, and sends corresponding boundary events for pointer if | 149 // pointer, and sends corresponding boundary events for pointer if |
160 // setPointerPosition is true. It also sends corresponding boundary events | 150 // setPointerPosition is true. It also sends corresponding boundary events |
161 // for mouse if sendMouseEvent is true. | 151 // for mouse if sendMouseEvent is true. |
162 // Returns the target that the pointer event is supposed to be fired at. | 152 // Returns the target that the pointer event is supposed to be fired at. |
163 EventTarget* processCaptureAndPositionOfPointerEvent( | 153 EventTarget* processCaptureAndPositionOfPointerEvent( |
164 PointerEvent*, | 154 PointerEvent*, |
165 EventTarget* hitTestTarget, | 155 EventTarget* hitTestTarget, |
166 EventTarget* lastNodeUnderMouse = nullptr, | |
167 const PlatformMouseEvent& = PlatformMouseEvent(), | 156 const PlatformMouseEvent& = PlatformMouseEvent(), |
168 bool sendMouseEvent = false, | 157 bool sendMouseEvent = false); |
169 bool setPointerPosition = true); | |
170 | 158 |
171 void removeTargetFromPointerCapturingMapping( | 159 void removeTargetFromPointerCapturingMapping( |
172 PointerCapturingMap&, const EventTarget*); | 160 PointerCapturingMap&, const EventTarget*); |
173 EventTarget* getEffectiveTargetForPointerEvent( | 161 EventTarget* getEffectiveTargetForPointerEvent( |
174 EventTarget*, int); | 162 EventTarget*, int); |
175 EventTarget* getCapturingNode(int); | 163 EventTarget* getCapturingNode(int); |
176 void removePointer(PointerEvent*); | 164 void removePointer(PointerEvent*); |
177 WebInputEventResult dispatchPointerEvent( | 165 WebInputEventResult dispatchPointerEvent( |
178 EventTarget*, | 166 EventTarget*, |
179 PointerEvent*, | 167 PointerEvent*, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 PointerCapturingMap m_pendingPointerCaptureTarget; | 200 PointerCapturingMap m_pendingPointerCaptureTarget; |
213 | 201 |
214 PointerEventFactory m_pointerEventFactory; | 202 PointerEventFactory m_pointerEventFactory; |
215 Member<TouchEventManager> m_touchEventManager; | 203 Member<TouchEventManager> m_touchEventManager; |
216 Member<MouseEventManager> m_mouseEventManager; | 204 Member<MouseEventManager> m_mouseEventManager; |
217 }; | 205 }; |
218 | 206 |
219 } // namespace blink | 207 } // namespace blink |
220 | 208 |
221 #endif // PointerEventManager_h | 209 #endif // PointerEventManager_h |
OLD | NEW |