OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "core/input/MouseEventManager.h" | 33 #include "core/input/MouseEventManager.h" |
34 #include "core/input/PointerEventManager.h" | 34 #include "core/input/PointerEventManager.h" |
35 #include "core/input/ScrollManager.h" | 35 #include "core/input/ScrollManager.h" |
36 #include "core/layout/HitTestRequest.h" | 36 #include "core/layout/HitTestRequest.h" |
37 #include "core/page/DragActions.h" | 37 #include "core/page/DragActions.h" |
38 #include "core/page/EventWithHitTestResults.h" | 38 #include "core/page/EventWithHitTestResults.h" |
39 #include "core/style/ComputedStyleConstants.h" | 39 #include "core/style/ComputedStyleConstants.h" |
40 #include "platform/Cursor.h" | 40 #include "platform/Cursor.h" |
41 #include "platform/PlatformMouseEvent.h" | 41 #include "platform/PlatformMouseEvent.h" |
42 #include "platform/PlatformTouchPoint.h" | 42 #include "platform/PlatformTouchPoint.h" |
43 #include "platform/Timer.h" | |
44 #include "platform/UserGestureIndicator.h" | 43 #include "platform/UserGestureIndicator.h" |
45 #include "platform/geometry/LayoutPoint.h" | 44 #include "platform/geometry/LayoutPoint.h" |
46 #include "platform/heap/Handle.h" | 45 #include "platform/heap/Handle.h" |
47 #include "platform/scroll/ScrollTypes.h" | 46 #include "platform/scroll/ScrollTypes.h" |
48 #include "public/platform/WebInputEvent.h" | 47 #include "public/platform/WebInputEvent.h" |
49 #include "public/platform/WebInputEventResult.h" | 48 #include "public/platform/WebInputEventResult.h" |
50 #include "wtf/Forward.h" | 49 #include "wtf/Forward.h" |
51 #include "wtf/HashMap.h" | 50 #include "wtf/HashMap.h" |
52 #include "wtf/HashTraits.h" | 51 #include "wtf/HashTraits.h" |
53 #include "wtf/RefPtr.h" | 52 #include "wtf/RefPtr.h" |
54 | 53 |
55 namespace blink { | 54 namespace blink { |
56 | 55 |
57 class DataTransfer; | 56 class DataTransfer; |
58 class PaintLayer; | 57 class PaintLayer; |
59 class Document; | 58 class Document; |
60 class DragState; | |
61 class Element; | 59 class Element; |
62 class Event; | 60 class Event; |
63 class EventTarget; | 61 class EventTarget; |
64 template <typename EventType> | 62 template <typename EventType> |
65 class EventWithHitTestResults; | 63 class EventWithHitTestResults; |
66 class FloatPoint; | 64 class FloatPoint; |
67 class FloatQuad; | 65 class FloatQuad; |
68 class FrameHost; | 66 class FrameHost; |
69 class HTMLFrameSetElement; | 67 class HTMLFrameSetElement; |
70 class HitTestRequest; | 68 class HitTestRequest; |
71 class HitTestResult; | 69 class HitTestResult; |
72 class LayoutObject; | 70 class LayoutObject; |
73 class LocalFrame; | 71 class LocalFrame; |
74 class Node; | 72 class Node; |
75 class OptionalCursor; | 73 class OptionalCursor; |
76 class PlatformGestureEvent; | 74 class PlatformGestureEvent; |
77 class PlatformTouchEvent; | 75 class PlatformTouchEvent; |
78 class PlatformWheelEvent; | 76 class PlatformWheelEvent; |
79 class ScrollableArea; | 77 class ScrollableArea; |
80 class Scrollbar; | 78 class Scrollbar; |
81 class SelectionController; | 79 class SelectionController; |
82 class TextEvent; | 80 class TextEvent; |
83 class WheelEvent; | 81 class WheelEvent; |
84 class Widget; | 82 class Widget; |
85 | 83 |
86 enum class DragInitiator; | |
87 | |
88 class CORE_EXPORT EventHandler final | 84 class CORE_EXPORT EventHandler final |
89 : public GarbageCollectedFinalized<EventHandler> { | 85 : public GarbageCollectedFinalized<EventHandler> { |
90 WTF_MAKE_NONCOPYABLE(EventHandler); | 86 WTF_MAKE_NONCOPYABLE(EventHandler); |
91 | 87 |
92 public: | 88 public: |
93 explicit EventHandler(LocalFrame*); | 89 explicit EventHandler(LocalFrame*); |
94 ~EventHandler(); | |
95 DECLARE_TRACE(); | 90 DECLARE_TRACE(); |
96 | 91 |
97 void clear(); | 92 void clear(); |
98 void nodeWillBeRemoved(Node&); | 93 void nodeWillBeRemoved(Node&); |
99 | 94 |
100 void updateSelectionForMouseDrag(); | 95 void updateSelectionForMouseDrag(); |
101 void startMiddleClickAutoscroll(LayoutObject*); | 96 void startMiddleClickAutoscroll(LayoutObject*); |
102 | 97 |
103 // TODO(nzolghadr): Some of the APIs in this class only forward the action | 98 // TODO(nzolghadr): Some of the APIs in this class only forward the action |
104 // to the corresponding Manager class. We need to investigate whether it is | 99 // to the corresponding Manager class. We need to investigate whether it is |
105 // better to expose the manager instance itself later or can the access to | 100 // better to expose the manager instance itself later or can the access to |
106 // those APIs be more limited or removed. | 101 // those APIs be more limited or removed. |
107 | 102 |
108 void stopAutoscroll(); | 103 void stopAutoscroll(); |
109 | 104 |
110 void dispatchFakeMouseMoveEventSoon(); | 105 void dispatchFakeMouseMoveEventSoon(); |
111 void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&); | 106 void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&); |
112 | 107 |
113 HitTestResult hitTestResultAtPoint( | 108 HitTestResult hitTestResultAtPoint( |
114 const LayoutPoint&, | 109 const LayoutPoint&, |
115 HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | | 110 HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | |
116 HitTestRequest::Active, | 111 HitTestRequest::Active, |
117 const LayoutSize& padding = LayoutSize()); | 112 const LayoutSize& padding = LayoutSize()); |
118 | 113 |
119 bool mousePressed() const { return m_mousePressed; } | 114 bool mousePressed() const { return m_mouseEventManager->mousePressed(); } |
120 | 115 |
121 void setCapturingMouseEventsNode( | 116 void setCapturingMouseEventsNode( |
122 Node*); // A caller is responsible for resetting capturing node to 0. | 117 Node*); // A caller is responsible for resetting capturing node to 0. |
123 | 118 |
124 WebInputEventResult updateDragAndDrop(const PlatformMouseEvent&, | 119 WebInputEventResult updateDragAndDrop(const PlatformMouseEvent&, |
125 DataTransfer*); | 120 DataTransfer*); |
126 void cancelDragAndDrop(const PlatformMouseEvent&, DataTransfer*); | 121 void cancelDragAndDrop(const PlatformMouseEvent&, DataTransfer*); |
127 WebInputEventResult performDragAndDrop(const PlatformMouseEvent&, | 122 WebInputEventResult performDragAndDrop(const PlatformMouseEvent&, |
128 DataTransfer*); | 123 DataTransfer*); |
129 void updateDragStateAfterEditDragIfNeeded(Element* rootEditableElement); | 124 void updateDragStateAfterEditDragIfNeeded(Element* rootEditableElement); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // Returns whether pointerId is active or not | 196 // Returns whether pointerId is active or not |
202 bool isPointerEventActive(int); | 197 bool isPointerEventActive(int); |
203 | 198 |
204 void setPointerCapture(int, EventTarget*); | 199 void setPointerCapture(int, EventTarget*); |
205 void releasePointerCapture(int, EventTarget*); | 200 void releasePointerCapture(int, EventTarget*); |
206 bool hasPointerCapture(int, const EventTarget*) const; | 201 bool hasPointerCapture(int, const EventTarget*) const; |
207 bool hasProcessedPointerCapture(int, const EventTarget*) const; | 202 bool hasProcessedPointerCapture(int, const EventTarget*) const; |
208 | 203 |
209 void elementRemoved(EventTarget*); | 204 void elementRemoved(EventTarget*); |
210 | 205 |
211 void setMouseDownMayStartAutoscroll() { | 206 void setMouseDownMayStartAutoscroll(); |
212 m_mouseDownMayStartAutoscroll = true; | |
213 } | |
214 | 207 |
215 bool handleAccessKey(const WebKeyboardEvent&); | 208 bool handleAccessKey(const WebKeyboardEvent&); |
216 WebInputEventResult keyEvent(const WebKeyboardEvent&); | 209 WebInputEventResult keyEvent(const WebKeyboardEvent&); |
217 void defaultKeyboardEventHandler(KeyboardEvent*); | 210 void defaultKeyboardEventHandler(KeyboardEvent*); |
218 | 211 |
219 bool handleTextInputEvent(const String& text, | 212 bool handleTextInputEvent(const String& text, |
220 Event* underlyingEvent = nullptr, | 213 Event* underlyingEvent = nullptr, |
221 TextEventInputType = TextEventInputKeyboard); | 214 TextEventInputType = TextEventInputKeyboard); |
222 void defaultTextInputEventHandler(TextEvent*); | 215 void defaultTextInputEventHandler(TextEvent*); |
223 | 216 |
224 void dragSourceEndedAt(const PlatformMouseEvent&, DragOperation); | 217 void dragSourceEndedAt(const PlatformMouseEvent&, DragOperation); |
225 | 218 |
226 void focusDocumentView(); | |
227 | |
228 void capsLockStateMayHaveChanged(); // Only called by FrameSelection | 219 void capsLockStateMayHaveChanged(); // Only called by FrameSelection |
229 | 220 |
230 WebInputEventResult handleTouchEvent(const PlatformTouchEvent&); | 221 WebInputEventResult handleTouchEvent(const PlatformTouchEvent&); |
231 | 222 |
232 bool useHandCursor(Node*, bool isOverLink); | 223 bool useHandCursor(Node*, bool isOverLink); |
233 | 224 |
234 void notifyElementActivated(); | 225 void notifyElementActivated(); |
235 | 226 |
236 PassRefPtr<UserGestureToken> takeLastMouseDownGestureToken() { | 227 PassRefPtr<UserGestureToken> takeLastMouseDownGestureToken() { |
237 return m_lastMouseDownUserGestureToken.release(); | 228 return m_lastMouseDownUserGestureToken.release(); |
(...skipping 14 matching lines...) Expand all Loading... |
252 // a physical direction for each LayoutBox we try to scroll | 243 // a physical direction for each LayoutBox we try to scroll |
253 // based on that box's writing mode. | 244 // based on that box's writing mode. |
254 // granularity - The units that the scroll delta parameter is in. | 245 // granularity - The units that the scroll delta parameter is in. |
255 // startNode - Optional. If provided, start chaining from the given node. | 246 // startNode - Optional. If provided, start chaining from the given node. |
256 // If not, use the current focus or last clicked node. | 247 // If not, use the current focus or last clicked node. |
257 bool logicalScroll(ScrollDirection, | 248 bool logicalScroll(ScrollDirection, |
258 ScrollGranularity, | 249 ScrollGranularity, |
259 Node* startNode = nullptr); | 250 Node* startNode = nullptr); |
260 | 251 |
261 private: | 252 private: |
262 static DragState& dragState(); | |
263 | |
264 DataTransfer* createDraggingDataTransfer() const; | |
265 | 253 |
266 WebInputEventResult handleMouseMoveOrLeaveEvent( | 254 WebInputEventResult handleMouseMoveOrLeaveEvent( |
267 const PlatformMouseEvent&, | 255 const PlatformMouseEvent&, |
268 HitTestResult* hoveredNode = nullptr, | 256 HitTestResult* hoveredNode = nullptr, |
269 bool onlyUpdateScrollbars = false, | 257 bool onlyUpdateScrollbars = false, |
270 bool forceLeave = false); | 258 bool forceLeave = false); |
271 WebInputEventResult handleMousePressEvent( | |
272 const MouseEventWithHitTestResults&); | |
273 WebInputEventResult handleMouseFocus( | |
274 const HitTestResult&, | |
275 InputDeviceCapabilities* sourceCapabilities); | |
276 WebInputEventResult handleMouseDraggedEvent( | |
277 const MouseEventWithHitTestResults&); | |
278 WebInputEventResult handleMouseReleaseEvent( | |
279 const MouseEventWithHitTestResults&); | |
280 | 259 |
281 HitTestRequest::HitTestRequestType getHitTypeForGestureType( | 260 HitTestRequest::HitTestRequestType getHitTypeForGestureType( |
282 PlatformEvent::EventType); | 261 PlatformEvent::EventType); |
283 void applyTouchAdjustment(PlatformGestureEvent*, HitTestResult*); | 262 void applyTouchAdjustment(PlatformGestureEvent*, HitTestResult*); |
284 WebInputEventResult handleGestureTapDown( | 263 WebInputEventResult handleGestureTapDown( |
285 const GestureEventWithHitTestResults&); | 264 const GestureEventWithHitTestResults&); |
286 WebInputEventResult handleGestureTap(const GestureEventWithHitTestResults&); | 265 WebInputEventResult handleGestureTap(const GestureEventWithHitTestResults&); |
287 WebInputEventResult handleGestureLongPress( | 266 WebInputEventResult handleGestureLongPress( |
288 const GestureEventWithHitTestResults&); | 267 const GestureEventWithHitTestResults&); |
289 WebInputEventResult handleGestureLongTap( | 268 WebInputEventResult handleGestureLongTap( |
290 const GestureEventWithHitTestResults&); | 269 const GestureEventWithHitTestResults&); |
291 | 270 |
292 void updateGestureTargetNodeForMouseEvent( | 271 void updateGestureTargetNodeForMouseEvent( |
293 const GestureEventWithHitTestResults&); | 272 const GestureEventWithHitTestResults&); |
294 | 273 |
295 bool shouldApplyTouchAdjustment(const PlatformGestureEvent&) const; | 274 bool shouldApplyTouchAdjustment(const PlatformGestureEvent&) const; |
296 | 275 |
297 OptionalCursor selectCursor(const HitTestResult&); | 276 OptionalCursor selectCursor(const HitTestResult&); |
298 OptionalCursor selectAutoCursor(const HitTestResult&, | 277 OptionalCursor selectAutoCursor(const HitTestResult&, |
299 Node*, | 278 Node*, |
300 const Cursor& iBeam); | 279 const Cursor& iBeam); |
301 | 280 |
302 void hoverTimerFired(TimerBase*); | 281 void hoverTimerFired(TimerBase*); |
303 void cursorUpdateTimerFired(TimerBase*); | 282 void cursorUpdateTimerFired(TimerBase*); |
304 void activeIntervalTimerFired(TimerBase*); | 283 void activeIntervalTimerFired(TimerBase*); |
305 | 284 |
306 void fakeMouseMoveEventTimerFired(TimerBase*); | |
307 void cancelFakeMouseMoveEvent(); | |
308 bool isCursorVisible() const; | |
309 void updateCursor(); | 285 void updateCursor(); |
310 | 286 |
311 ScrollableArea* associatedScrollableArea(const PaintLayer*) const; | 287 ScrollableArea* associatedScrollableArea(const PaintLayer*) const; |
312 | 288 |
313 void invalidateClick(); | 289 Node* updateMouseEventTargetNode(Node*); |
314 | |
315 Node* updateMouseEventTargetNode(Node*, const PlatformMouseEvent&); | |
316 void updateMouseEventTargetNodeAndSendEvents( | |
317 Node*, | |
318 const PlatformMouseEvent&, | |
319 bool isFrameBoundaryTransition = false); | |
320 | |
321 MouseEventWithHitTestResults prepareMouseEvent(const HitTestRequest&, | |
322 const PlatformMouseEvent&); | |
323 | |
324 WebInputEventResult dispatchMouseEvent(const AtomicString& eventType, | |
325 Node* target, | |
326 int clickCount, | |
327 const PlatformMouseEvent&); | |
328 | 290 |
329 // Dispatches ME after corresponding PE provided the PE has not been canceled.
The eventType arg | 291 // Dispatches ME after corresponding PE provided the PE has not been canceled.
The eventType arg |
330 // must be a mouse event that can be gated though a preventDefaulted pointerdo
wn (i.e., one of | 292 // must be a mouse event that can be gated though a preventDefaulted pointerdo
wn (i.e., one of |
331 // {mousedown, mousemove, mouseup}). | 293 // {mousedown, mousemove, mouseup}). |
332 // TODO(mustaq): Can we avoid the clickCount param, instead use PlatformMouseE
vent's count? | 294 // TODO(mustaq): Can we avoid the clickCount param, instead use PlatformMouseE
vent's count? |
333 // Same applied to dispatchMouseEvent() above. | 295 // Same applied to dispatchMouseEvent() above. |
334 WebInputEventResult updatePointerTargetAndDispatchEvents( | 296 WebInputEventResult updatePointerTargetAndDispatchEvents( |
335 const AtomicString& mouseEventType, | 297 const AtomicString& mouseEventType, |
336 Node* target, | 298 Node* target, |
337 int clickCount, | |
338 const PlatformMouseEvent&); | 299 const PlatformMouseEvent&); |
339 | 300 |
340 WebInputEventResult dispatchDragEvent(const AtomicString& eventType, | |
341 Node* target, | |
342 const PlatformMouseEvent&, | |
343 DataTransfer*); | |
344 | |
345 void clearDragDataTransfer(); | |
346 | |
347 bool handleDrag(const MouseEventWithHitTestResults&, DragInitiator); | |
348 bool tryStartDrag(const MouseEventWithHitTestResults&); | |
349 | |
350 // Clears drag target and related states. It is called when drag is done or ca
nceled. | 301 // Clears drag target and related states. It is called when drag is done or ca
nceled. |
351 void clearDragState(); | 302 void clearDragState(); |
352 | 303 |
353 // Resets the state that indicates the next events could cause a drag. It is c
alled when | |
354 // we realize the next events should not cause drag based on the drag heuristi
cs. | |
355 void clearDragHeuristicState(); | |
356 | |
357 WebInputEventResult dispatchDragSrcEvent(const AtomicString& eventType, | |
358 const PlatformMouseEvent&); | |
359 | |
360 bool dragHysteresisExceeded(const IntPoint&) const; | |
361 | |
362 WebInputEventResult passMousePressEventToSubframe( | 304 WebInputEventResult passMousePressEventToSubframe( |
363 MouseEventWithHitTestResults&, | 305 MouseEventWithHitTestResults&, |
364 LocalFrame* subframe); | 306 LocalFrame* subframe); |
365 WebInputEventResult passMouseMoveEventToSubframe( | 307 WebInputEventResult passMouseMoveEventToSubframe( |
366 MouseEventWithHitTestResults&, | 308 MouseEventWithHitTestResults&, |
367 LocalFrame* subframe, | 309 LocalFrame* subframe, |
368 HitTestResult* hoveredNode = nullptr); | 310 HitTestResult* hoveredNode = nullptr); |
369 WebInputEventResult passMouseReleaseEventToSubframe( | 311 WebInputEventResult passMouseReleaseEventToSubframe( |
370 MouseEventWithHitTestResults&, | 312 MouseEventWithHitTestResults&, |
371 LocalFrame* subframe); | 313 LocalFrame* subframe); |
372 | 314 |
373 bool passMousePressEventToScrollbar(MouseEventWithHitTestResults&); | 315 bool passMousePressEventToScrollbar(MouseEventWithHitTestResults&); |
374 | 316 |
375 void defaultSpaceEventHandler(KeyboardEvent*); | 317 void defaultSpaceEventHandler(KeyboardEvent*); |
376 void defaultBackspaceEventHandler(KeyboardEvent*); | 318 void defaultBackspaceEventHandler(KeyboardEvent*); |
377 void defaultTabEventHandler(KeyboardEvent*); | 319 void defaultTabEventHandler(KeyboardEvent*); |
378 void defaultEscapeEventHandler(KeyboardEvent*); | 320 void defaultEscapeEventHandler(KeyboardEvent*); |
379 void defaultArrowEventHandler(WebFocusType, KeyboardEvent*); | 321 void defaultArrowEventHandler(WebFocusType, KeyboardEvent*); |
380 | 322 |
381 void updateLastScrollbarUnderMouse(Scrollbar*, bool); | 323 void updateLastScrollbarUnderMouse(Scrollbar*, bool); |
382 | 324 |
383 bool capturesDragging() const { return m_capturesDragging; } | |
384 | |
385 WebInputEventResult handleGestureShowPress(); | 325 WebInputEventResult handleGestureShowPress(); |
386 | 326 |
387 void setLastKnownMousePosition(const PlatformMouseEvent&); | |
388 | |
389 void setClickNode(Node*); | |
390 bool handleDragDropIfPossible(const GestureEventWithHitTestResults&); | |
391 static ContainerNode* parentForClickEvent(const Node&); | |
392 | |
393 bool shouldTopControlsConsumeScroll(FloatSize) const; | 327 bool shouldTopControlsConsumeScroll(FloatSize) const; |
394 | 328 |
395 // If the given element is a shadow host and its root has delegatesFocus=false
flag, | |
396 // slide focus to its inner element. Returns true if the resulting focus is di
fferent from | |
397 // the given element. | |
398 bool slideFocusOnShadowHostIfNecessary(const Element&); | |
399 | |
400 FrameHost* frameHost() const; | 329 FrameHost* frameHost() const; |
401 | 330 |
402 // NOTE: If adding a new field to this class please ensure that it is | 331 // NOTE: If adding a new field to this class please ensure that it is |
403 // cleared in |EventHandler::clear()|. | 332 // cleared in |EventHandler::clear()|. |
404 | 333 |
405 const Member<LocalFrame> m_frame; | 334 const Member<LocalFrame> m_frame; |
406 | 335 |
407 // Current button-press state for mouse/mouse-like-stylus. | |
408 // TODO(crbug.com/563676): Buggy for chorded buttons. | |
409 bool m_mousePressed; | |
410 | |
411 bool m_capturesDragging; | |
412 Member<Node> m_mousePressNode; | |
413 | |
414 bool m_mouseDownMayStartDrag; | |
415 const Member<SelectionController> m_selectionController; | 336 const Member<SelectionController> m_selectionController; |
416 | 337 |
417 LayoutPoint m_dragStartPos; | |
418 | |
419 Timer<EventHandler> m_hoverTimer; | 338 Timer<EventHandler> m_hoverTimer; |
420 | 339 |
421 // TODO(rbyers): Mouse cursor update is page-wide, not per-frame. Page-wide s
tate | 340 // TODO(rbyers): Mouse cursor update is page-wide, not per-frame. Page-wide s
tate |
422 // should move out of EventHandler to a new PageEventHandler class. crbug.com/
449649 | 341 // should move out of EventHandler to a new PageEventHandler class. crbug.com/
449649 |
423 Timer<EventHandler> m_cursorUpdateTimer; | 342 Timer<EventHandler> m_cursorUpdateTimer; |
424 | 343 |
425 bool m_mouseDownMayStartAutoscroll; | |
426 | |
427 Timer<EventHandler> m_fakeMouseMoveEventTimer; | |
428 | |
429 bool m_svgPan; | |
430 | |
431 Member<Node> m_capturingMouseEventsNode; | 344 Member<Node> m_capturingMouseEventsNode; |
432 bool m_eventHandlerWillResetCapturingMouseEventsNode; | 345 bool m_eventHandlerWillResetCapturingMouseEventsNode; |
433 | 346 |
434 // TODO(nzolghadr): Refactor the mouse related fields to MouseEventManager. | |
435 // Note the difference of this and m_nodeUnderPointer in PointerEventManager | |
436 Member<Node> m_nodeUnderMouse; | |
437 | |
438 Member<LocalFrame> m_lastMouseMoveEventSubframe; | 347 Member<LocalFrame> m_lastMouseMoveEventSubframe; |
439 Member<Scrollbar> m_lastScrollbarUnderMouse; | 348 Member<Scrollbar> m_lastScrollbarUnderMouse; |
440 | 349 |
441 int m_clickCount; | |
442 Member<Node> m_clickNode; | |
443 | |
444 Member<Node> m_dragTarget; | 350 Member<Node> m_dragTarget; |
445 bool m_shouldOnlyFireDragOverEvent; | 351 bool m_shouldOnlyFireDragOverEvent; |
446 | 352 |
447 Member<HTMLFrameSetElement> m_frameSetBeingResized; | 353 Member<HTMLFrameSetElement> m_frameSetBeingResized; |
448 | 354 |
449 bool m_mousePositionIsUnknown; | |
450 // The last mouse movement position this frame has seen in root frame coordina
tes. | |
451 IntPoint m_lastKnownMousePosition; | |
452 IntPoint m_lastKnownMouseGlobalPosition; | |
453 IntPoint m_mouseDownPos; // In our view's coords. | |
454 double m_mouseDownTimestamp; | |
455 PlatformMouseEvent m_mouseDown; | |
456 RefPtr<UserGestureToken> m_lastMouseDownUserGestureToken; | 355 RefPtr<UserGestureToken> m_lastMouseDownUserGestureToken; |
457 | 356 |
458 Member<ScrollManager> m_scrollManager; | 357 Member<ScrollManager> m_scrollManager; |
459 Member<MouseEventManager> m_mouseEventManager; | 358 Member<MouseEventManager> m_mouseEventManager; |
460 Member<KeyboardEventManager> m_keyboardEventManager; | 359 Member<KeyboardEventManager> m_keyboardEventManager; |
461 Member<PointerEventManager> m_pointerEventManager; | 360 Member<PointerEventManager> m_pointerEventManager; |
462 Member<GestureManager> m_gestureManager; | 361 Member<GestureManager> m_gestureManager; |
463 | 362 |
464 double m_maxMouseMovedDuration; | 363 double m_maxMouseMovedDuration; |
465 | 364 |
466 bool m_longTapShouldInvokeContextMenu; | 365 bool m_longTapShouldInvokeContextMenu; |
467 | 366 |
468 Timer<EventHandler> m_activeIntervalTimer; | 367 Timer<EventHandler> m_activeIntervalTimer; |
469 double m_lastShowPressTimestamp; | 368 double m_lastShowPressTimestamp; |
470 Member<Element> m_lastDeferredTapElement; | 369 Member<Element> m_lastDeferredTapElement; |
471 | 370 |
472 // Set on GestureTapDown if the |pointerdown| event corresponding to the | 371 // Set on GestureTapDown if the |pointerdown| event corresponding to the |
473 // triggering |touchstart| event was canceled. This suppresses mouse event | 372 // triggering |touchstart| event was canceled. This suppresses mouse event |
474 // firing for the current gesture sequence (i.e. until next GestureTapDown). | 373 // firing for the current gesture sequence (i.e. until next GestureTapDown). |
475 bool m_suppressMouseEventsFromGestures; | 374 bool m_suppressMouseEventsFromGestures; |
476 | 375 |
477 // TODO(nzolghadr): Temporary until further refactoring | |
478 friend GestureManager; | |
479 }; | 376 }; |
480 | 377 |
481 } // namespace blink | 378 } // namespace blink |
482 | 379 |
483 #endif // EventHandler_h | 380 #endif // EventHandler_h |
OLD | NEW |