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 MouseEventManager_h | 5 #ifndef MouseEventManager_h |
6 #define MouseEventManager_h | 6 #define MouseEventManager_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/input/BoundaryEventDispatcher.h" | 9 #include "core/input/BoundaryEventDispatcher.h" |
10 #include "core/page/DragActions.h" | 10 #include "core/page/DragActions.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 const MouseEventWithHitTestResults&); | 87 const MouseEventWithHitTestResults&); |
88 WebInputEventResult handleMouseReleaseEvent( | 88 WebInputEventResult handleMouseReleaseEvent( |
89 const MouseEventWithHitTestResults&); | 89 const MouseEventWithHitTestResults&); |
90 | 90 |
91 void nodeWillBeRemoved(Node& nodeToBeRemoved); | 91 void nodeWillBeRemoved(Node& nodeToBeRemoved); |
92 | 92 |
93 static DragState& dragState(); | 93 static DragState& dragState(); |
94 | 94 |
95 void focusDocumentView(); | 95 void focusDocumentView(); |
96 | 96 |
97 // Resets the state that indicates the next events could cause a drag. It is c
alled when | 97 // Resets the state that indicates the next events could cause a drag. It is |
98 // we realize the next events should not cause drag based on the drag heuristi
cs. | 98 // called when we realize the next events should not cause drag based on the |
| 99 // drag heuristics. |
99 void clearDragHeuristicState(); | 100 void clearDragHeuristicState(); |
100 | 101 |
101 void dragSourceEndedAt(const PlatformMouseEvent&, DragOperation); | 102 void dragSourceEndedAt(const PlatformMouseEvent&, DragOperation); |
102 | 103 |
103 void updateSelectionForMouseDrag(); | 104 void updateSelectionForMouseDrag(); |
104 | 105 |
105 void handleMousePressEventUpdateStates(const PlatformMouseEvent&); | 106 void handleMousePressEventUpdateStates(const PlatformMouseEvent&); |
106 | 107 |
107 // Returns whether pan is handled and resets the state on release. | 108 // Returns whether pan is handled and resets the state on release. |
108 bool handleSvgPanIfNeeded(bool isReleaseEvent); | 109 bool handleSvgPanIfNeeded(bool isReleaseEvent); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 void dispatch(EventTarget*, | 159 void dispatch(EventTarget*, |
159 EventTarget* relatedTarget, | 160 EventTarget* relatedTarget, |
160 const AtomicString&, | 161 const AtomicString&, |
161 const PlatformMouseEvent&, | 162 const PlatformMouseEvent&, |
162 bool checkForListener); | 163 bool checkForListener); |
163 Member<MouseEventManager> m_mouseEventManager; | 164 Member<MouseEventManager> m_mouseEventManager; |
164 const PlatformMouseEvent* m_platformMouseEvent; | 165 const PlatformMouseEvent* m_platformMouseEvent; |
165 Member<EventTarget> m_exitedTarget; | 166 Member<EventTarget> m_exitedTarget; |
166 }; | 167 }; |
167 | 168 |
168 // If the given element is a shadow host and its root has delegatesFocus=false
flag, | 169 // If the given element is a shadow host and its root has delegatesFocus=false |
169 // slide focus to its inner element. Returns true if the resulting focus is di
fferent from | 170 // flag, slide focus to its inner element. Returns true if the resulting focus |
170 // the given element. | 171 // is different from the given element. |
171 bool slideFocusOnShadowHostIfNecessary(const Element&); | 172 bool slideFocusOnShadowHostIfNecessary(const Element&); |
172 | 173 |
173 bool dragHysteresisExceeded(const IntPoint&) const; | 174 bool dragHysteresisExceeded(const IntPoint&) const; |
174 bool handleDrag(const MouseEventWithHitTestResults&, DragInitiator); | 175 bool handleDrag(const MouseEventWithHitTestResults&, DragInitiator); |
175 bool tryStartDrag(const MouseEventWithHitTestResults&); | 176 bool tryStartDrag(const MouseEventWithHitTestResults&); |
176 void clearDragDataTransfer(); | 177 void clearDragDataTransfer(); |
177 DataTransfer* createDraggingDataTransfer() const; | 178 DataTransfer* createDraggingDataTransfer() const; |
178 | 179 |
179 // NOTE: If adding a new field to this class please ensure that it is | 180 // NOTE: If adding a new field to this class please ensure that it is |
180 // cleared in |MouseEventManager::clear()|. | 181 // cleared in |MouseEventManager::clear()|. |
181 | 182 |
182 const Member<LocalFrame> m_frame; | 183 const Member<LocalFrame> m_frame; |
183 Member<ScrollManager> m_scrollManager; | 184 Member<ScrollManager> m_scrollManager; |
184 | 185 |
185 // The effective position of the mouse pointer. | 186 // The effective position of the mouse pointer. |
186 // See https://w3c.github.io/pointerevents/#dfn-tracking-the-effective-positio
n-of-the-legacy-mouse-pointer. | 187 // See |
| 188 // https://w3c.github.io/pointerevents/#dfn-tracking-the-effective-position-of
-the-legacy-mouse-pointer. |
187 Member<Node> m_nodeUnderMouse; | 189 Member<Node> m_nodeUnderMouse; |
188 | 190 |
189 // The last mouse movement position this frame has seen in root frame coordina
tes. | 191 // The last mouse movement position this frame has seen in root frame |
| 192 // coordinates. |
190 IntPoint m_lastKnownMousePosition; | 193 IntPoint m_lastKnownMousePosition; |
191 IntPoint m_lastKnownMouseGlobalPosition; | 194 IntPoint m_lastKnownMouseGlobalPosition; |
192 | 195 |
193 unsigned m_isMousePositionUnknown : 1; | 196 unsigned m_isMousePositionUnknown : 1; |
194 // Current button-press state for mouse/mouse-like-stylus. | 197 // Current button-press state for mouse/mouse-like-stylus. |
195 // TODO(crbug.com/563676): Buggy for chorded buttons. | 198 // TODO(crbug.com/563676): Buggy for chorded buttons. |
196 unsigned m_mousePressed : 1; | 199 unsigned m_mousePressed : 1; |
197 | 200 |
198 unsigned m_mouseDownMayStartAutoscroll : 1; | 201 unsigned m_mouseDownMayStartAutoscroll : 1; |
199 unsigned m_svgPan : 1; | 202 unsigned m_svgPan : 1; |
(...skipping 10 matching lines...) Expand all Loading... |
210 PlatformMouseEvent m_mouseDown; | 213 PlatformMouseEvent m_mouseDown; |
211 | 214 |
212 LayoutPoint m_dragStartPos; | 215 LayoutPoint m_dragStartPos; |
213 | 216 |
214 Timer<MouseEventManager> m_fakeMouseMoveEventTimer; | 217 Timer<MouseEventManager> m_fakeMouseMoveEventTimer; |
215 }; | 218 }; |
216 | 219 |
217 } // namespace blink | 220 } // namespace blink |
218 | 221 |
219 #endif // MouseEventManager_h | 222 #endif // MouseEventManager_h |
OLD | NEW |