| 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 : public GarbageCollectedFinalized<EventHan
dler> { | 84 class CORE_EXPORT EventHandler final : public GarbageCollectedFinalized<EventHan
dler> { |
| 89 | 85 |
| 90 WTF_MAKE_NONCOPYABLE(EventHandler); | 86 WTF_MAKE_NONCOPYABLE(EventHandler); |
| 91 public: | 87 public: |
| 92 explicit EventHandler(LocalFrame*); | 88 explicit EventHandler(LocalFrame*); |
| 93 ~EventHandler(); | |
| 94 DECLARE_TRACE(); | 89 DECLARE_TRACE(); |
| 95 | 90 |
| 96 void clear(); | 91 void clear(); |
| 97 void nodeWillBeRemoved(Node&); | 92 void nodeWillBeRemoved(Node&); |
| 98 | 93 |
| 99 void updateSelectionForMouseDrag(); | 94 void updateSelectionForMouseDrag(); |
| 100 void startMiddleClickAutoscroll(LayoutObject*); | 95 void startMiddleClickAutoscroll(LayoutObject*); |
| 101 | 96 |
| 102 // TODO(nzolghadr): Some of the APIs in this class only forward the action | 97 // TODO(nzolghadr): Some of the APIs in this class only forward the action |
| 103 // to the corresponding Manager class. We need to investigate whether it is | 98 // to the corresponding Manager class. We need to investigate whether it is |
| 104 // better to expose the manager instance itself later or can the access to | 99 // better to expose the manager instance itself later or can the access to |
| 105 // those APIs be more limited or removed. | 100 // those APIs be more limited or removed. |
| 106 | 101 |
| 107 void stopAutoscroll(); | 102 void stopAutoscroll(); |
| 108 | 103 |
| 109 void dispatchFakeMouseMoveEventSoon(); | 104 void dispatchFakeMouseMoveEventSoon(); |
| 110 void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&); | 105 void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&); |
| 111 | 106 |
| 112 HitTestResult hitTestResultAtPoint(const LayoutPoint&, | 107 HitTestResult hitTestResultAtPoint(const LayoutPoint&, |
| 113 HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly |
HitTestRequest::Active, | 108 HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly |
HitTestRequest::Active, |
| 114 const LayoutSize& padding = LayoutSize()); | 109 const LayoutSize& padding = LayoutSize()); |
| 115 | 110 |
| 116 bool mousePressed() const { return m_mousePressed; } | 111 bool mousePressed() const { return m_mouseEventManager->mousePressed(); } |
| 117 | 112 |
| 118 void setCapturingMouseEventsNode(Node*); // A caller is responsible for rese
tting capturing node to 0. | 113 void setCapturingMouseEventsNode(Node*); // A caller is responsible for rese
tting capturing node to 0. |
| 119 | 114 |
| 120 WebInputEventResult updateDragAndDrop(const PlatformMouseEvent&, DataTransfe
r*); | 115 WebInputEventResult updateDragAndDrop(const PlatformMouseEvent&, DataTransfe
r*); |
| 121 void cancelDragAndDrop(const PlatformMouseEvent&, DataTransfer*); | 116 void cancelDragAndDrop(const PlatformMouseEvent&, DataTransfer*); |
| 122 WebInputEventResult performDragAndDrop(const PlatformMouseEvent&, DataTransf
er*); | 117 WebInputEventResult performDragAndDrop(const PlatformMouseEvent&, DataTransf
er*); |
| 123 void updateDragStateAfterEditDragIfNeeded(Element* rootEditableElement); | 118 void updateDragStateAfterEditDragIfNeeded(Element* rootEditableElement); |
| 124 | 119 |
| 125 void scheduleHoverStateUpdate(); | 120 void scheduleHoverStateUpdate(); |
| 126 void scheduleCursorUpdate(); | 121 void scheduleCursorUpdate(); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 // Returns whether pointerId is active or not | 175 // Returns whether pointerId is active or not |
| 181 bool isPointerEventActive(int); | 176 bool isPointerEventActive(int); |
| 182 | 177 |
| 183 void setPointerCapture(int, EventTarget*); | 178 void setPointerCapture(int, EventTarget*); |
| 184 void releasePointerCapture(int, EventTarget*); | 179 void releasePointerCapture(int, EventTarget*); |
| 185 bool hasPointerCapture(int, const EventTarget*) const; | 180 bool hasPointerCapture(int, const EventTarget*) const; |
| 186 bool hasProcessedPointerCapture(int, const EventTarget*) const; | 181 bool hasProcessedPointerCapture(int, const EventTarget*) const; |
| 187 | 182 |
| 188 void elementRemoved(EventTarget*); | 183 void elementRemoved(EventTarget*); |
| 189 | 184 |
| 190 void setMouseDownMayStartAutoscroll() { m_mouseDownMayStartAutoscroll = true
; } | 185 void setMouseDownMayStartAutoscroll(); |
| 191 | 186 |
| 192 bool handleAccessKey(const WebKeyboardEvent&); | 187 bool handleAccessKey(const WebKeyboardEvent&); |
| 193 WebInputEventResult keyEvent(const WebKeyboardEvent&); | 188 WebInputEventResult keyEvent(const WebKeyboardEvent&); |
| 194 void defaultKeyboardEventHandler(KeyboardEvent*); | 189 void defaultKeyboardEventHandler(KeyboardEvent*); |
| 195 | 190 |
| 196 bool handleTextInputEvent(const String& text, Event* underlyingEvent = nullp
tr, TextEventInputType = TextEventInputKeyboard); | 191 bool handleTextInputEvent(const String& text, Event* underlyingEvent = nullp
tr, TextEventInputType = TextEventInputKeyboard); |
| 197 void defaultTextInputEventHandler(TextEvent*); | 192 void defaultTextInputEventHandler(TextEvent*); |
| 198 | 193 |
| 199 void dragSourceEndedAt(const PlatformMouseEvent&, DragOperation); | 194 void dragSourceEndedAt(const PlatformMouseEvent&, DragOperation); |
| 200 | 195 |
| 201 void focusDocumentView(); | |
| 202 | |
| 203 void capsLockStateMayHaveChanged(); // Only called by FrameSelection | 196 void capsLockStateMayHaveChanged(); // Only called by FrameSelection |
| 204 | 197 |
| 205 WebInputEventResult handleTouchEvent(const PlatformTouchEvent&); | 198 WebInputEventResult handleTouchEvent(const PlatformTouchEvent&); |
| 206 | 199 |
| 207 bool useHandCursor(Node*, bool isOverLink); | 200 bool useHandCursor(Node*, bool isOverLink); |
| 208 | 201 |
| 209 void notifyElementActivated(); | 202 void notifyElementActivated(); |
| 210 | 203 |
| 211 PassRefPtr<UserGestureToken> takeLastMouseDownGestureToken() { return m_last
MouseDownUserGestureToken.release(); } | 204 PassRefPtr<UserGestureToken> takeLastMouseDownGestureToken() { return m_last
MouseDownUserGestureToken.release(); } |
| 212 | 205 |
| 213 SelectionController& selectionController() const { return *m_selectionContro
ller; } | 206 SelectionController& selectionController() const { return *m_selectionContro
ller; } |
| 214 | 207 |
| 215 // FIXME(nzolghadr): This function is technically a private function of | 208 // FIXME(nzolghadr): This function is technically a private function of |
| 216 // EventHandler class. Making it public temporary to make it possible to | 209 // EventHandler class. Making it public temporary to make it possible to |
| 217 // move some code around in the refactoring process. | 210 // move some code around in the refactoring process. |
| 218 // Performs a chaining logical scroll, within a *single* frame, starting | 211 // Performs a chaining logical scroll, within a *single* frame, starting |
| 219 // from either a provided starting node or a default based on the focused or | 212 // from either a provided starting node or a default based on the focused or |
| 220 // most recently clicked node, falling back to the frame. | 213 // most recently clicked node, falling back to the frame. |
| 221 // Returns true if the scroll was consumed. | 214 // Returns true if the scroll was consumed. |
| 222 // direction - The logical direction to scroll in. This will be converted to | 215 // direction - The logical direction to scroll in. This will be converted to |
| 223 // a physical direction for each LayoutBox we try to scroll | 216 // a physical direction for each LayoutBox we try to scroll |
| 224 // based on that box's writing mode. | 217 // based on that box's writing mode. |
| 225 // granularity - The units that the scroll delta parameter is in. | 218 // granularity - The units that the scroll delta parameter is in. |
| 226 // startNode - Optional. If provided, start chaining from the given node. | 219 // startNode - Optional. If provided, start chaining from the given node. |
| 227 // If not, use the current focus or last clicked node. | 220 // If not, use the current focus or last clicked node. |
| 228 bool logicalScroll(ScrollDirection, ScrollGranularity, Node* startNode = nul
lptr); | 221 bool logicalScroll(ScrollDirection, ScrollGranularity, Node* startNode = nul
lptr); |
| 229 | 222 |
| 230 private: | 223 private: |
| 231 static DragState& dragState(); | |
| 232 | |
| 233 DataTransfer* createDraggingDataTransfer() const; | |
| 234 | |
| 235 WebInputEventResult handleMouseMoveOrLeaveEvent(const PlatformMouseEvent&, H
itTestResult* hoveredNode = nullptr, bool onlyUpdateScrollbars = false, bool for
ceLeave = false); | 224 WebInputEventResult handleMouseMoveOrLeaveEvent(const PlatformMouseEvent&, H
itTestResult* hoveredNode = nullptr, bool onlyUpdateScrollbars = false, bool for
ceLeave = false); |
| 236 WebInputEventResult handleMousePressEvent(const MouseEventWithHitTestResults
&); | |
| 237 WebInputEventResult handleMouseFocus(const HitTestResult&, InputDeviceCapabi
lities* sourceCapabilities); | |
| 238 WebInputEventResult handleMouseDraggedEvent(const MouseEventWithHitTestResul
ts&); | |
| 239 WebInputEventResult handleMouseReleaseEvent(const MouseEventWithHitTestResul
ts&); | |
| 240 | 225 |
| 241 HitTestRequest::HitTestRequestType getHitTypeForGestureType(PlatformEvent::E
ventType); | 226 HitTestRequest::HitTestRequestType getHitTypeForGestureType(PlatformEvent::E
ventType); |
| 242 void applyTouchAdjustment(PlatformGestureEvent*, HitTestResult*); | 227 void applyTouchAdjustment(PlatformGestureEvent*, HitTestResult*); |
| 243 WebInputEventResult handleGestureTapDown(const GestureEventWithHitTestResult
s&); | 228 WebInputEventResult handleGestureTapDown(const GestureEventWithHitTestResult
s&); |
| 244 WebInputEventResult handleGestureTap(const GestureEventWithHitTestResults&); | 229 WebInputEventResult handleGestureTap(const GestureEventWithHitTestResults&); |
| 245 WebInputEventResult handleGestureLongPress(const GestureEventWithHitTestResu
lts&); | 230 WebInputEventResult handleGestureLongPress(const GestureEventWithHitTestResu
lts&); |
| 246 WebInputEventResult handleGestureLongTap(const GestureEventWithHitTestResult
s&); | 231 WebInputEventResult handleGestureLongTap(const GestureEventWithHitTestResult
s&); |
| 247 | 232 |
| 248 void updateGestureTargetNodeForMouseEvent(const GestureEventWithHitTestResul
ts&); | 233 void updateGestureTargetNodeForMouseEvent(const GestureEventWithHitTestResul
ts&); |
| 249 | 234 |
| 250 bool shouldApplyTouchAdjustment(const PlatformGestureEvent&) const; | 235 bool shouldApplyTouchAdjustment(const PlatformGestureEvent&) const; |
| 251 | 236 |
| 252 OptionalCursor selectCursor(const HitTestResult&); | 237 OptionalCursor selectCursor(const HitTestResult&); |
| 253 OptionalCursor selectAutoCursor(const HitTestResult&, Node*, const Cursor& i
Beam); | 238 OptionalCursor selectAutoCursor(const HitTestResult&, Node*, const Cursor& i
Beam); |
| 254 | 239 |
| 255 void hoverTimerFired(TimerBase*); | 240 void hoverTimerFired(TimerBase*); |
| 256 void cursorUpdateTimerFired(TimerBase*); | 241 void cursorUpdateTimerFired(TimerBase*); |
| 257 void activeIntervalTimerFired(TimerBase*); | 242 void activeIntervalTimerFired(TimerBase*); |
| 258 | 243 |
| 259 void fakeMouseMoveEventTimerFired(TimerBase*); | |
| 260 void cancelFakeMouseMoveEvent(); | |
| 261 bool isCursorVisible() const; | |
| 262 void updateCursor(); | 244 void updateCursor(); |
| 263 | 245 |
| 264 ScrollableArea* associatedScrollableArea(const PaintLayer*) const; | 246 ScrollableArea* associatedScrollableArea(const PaintLayer*) const; |
| 265 | 247 |
| 266 void invalidateClick(); | 248 Node* updateMouseEventTargetNode(Node*); |
| 267 | |
| 268 Node* updateMouseEventTargetNode(Node*, const PlatformMouseEvent&); | |
| 269 void updateMouseEventTargetNodeAndSendEvents(Node*, const PlatformMouseEvent
&, bool isFrameBoundaryTransition = false); | |
| 270 | |
| 271 | |
| 272 MouseEventWithHitTestResults prepareMouseEvent(const HitTestRequest&, const
PlatformMouseEvent&); | |
| 273 | |
| 274 WebInputEventResult dispatchMouseEvent(const AtomicString& eventType, Node*
target, int clickCount, const PlatformMouseEvent&); | |
| 275 | 249 |
| 276 // Dispatches ME after corresponding PE provided the PE has not been cancele
d. The eventType arg | 250 // Dispatches ME after corresponding PE provided the PE has not been cancele
d. The eventType arg |
| 277 // must be a mouse event that can be gated though a preventDefaulted pointer
down (i.e., one of | 251 // must be a mouse event that can be gated though a preventDefaulted pointer
down (i.e., one of |
| 278 // {mousedown, mousemove, mouseup}). | 252 // {mousedown, mousemove, mouseup}). |
| 279 // TODO(mustaq): Can we avoid the clickCount param, instead use PlatformMous
eEvent's count? | 253 // TODO(mustaq): Can we avoid the clickCount param, instead use PlatformMous
eEvent's count? |
| 280 // Same applied to dispatchMouseEvent() above. | 254 // Same applied to dispatchMouseEvent() above. |
| 281 WebInputEventResult updatePointerTargetAndDispatchEvents(const AtomicString&
mouseEventType, Node* target, | 255 WebInputEventResult updatePointerTargetAndDispatchEvents(const AtomicString&
mouseEventType, Node* target, |
| 282 int clickCount, const PlatformMouseEvent&); | 256 const PlatformMouseEvent&); |
| 283 | |
| 284 WebInputEventResult dispatchDragEvent(const AtomicString& eventType, Node* t
arget, const PlatformMouseEvent&, DataTransfer*); | |
| 285 | |
| 286 void clearDragDataTransfer(); | |
| 287 | |
| 288 bool handleDrag(const MouseEventWithHitTestResults&, DragInitiator); | |
| 289 bool tryStartDrag(const MouseEventWithHitTestResults&); | |
| 290 | 257 |
| 291 // Clears drag target and related states. It is called when drag is done or
canceled. | 258 // Clears drag target and related states. It is called when drag is done or
canceled. |
| 292 void clearDragState(); | 259 void clearDragState(); |
| 293 | 260 |
| 294 // Resets the state that indicates the next events could cause a drag. It is
called when | |
| 295 // we realize the next events should not cause drag based on the drag heuris
tics. | |
| 296 void clearDragHeuristicState(); | |
| 297 | |
| 298 WebInputEventResult dispatchDragSrcEvent(const AtomicString& eventType, cons
t PlatformMouseEvent&); | |
| 299 | |
| 300 bool dragHysteresisExceeded(const IntPoint&) const; | |
| 301 | |
| 302 WebInputEventResult passMousePressEventToSubframe(MouseEventWithHitTestResul
ts&, LocalFrame* subframe); | 261 WebInputEventResult passMousePressEventToSubframe(MouseEventWithHitTestResul
ts&, LocalFrame* subframe); |
| 303 WebInputEventResult passMouseMoveEventToSubframe(MouseEventWithHitTestResult
s&, LocalFrame* subframe, HitTestResult* hoveredNode = nullptr); | 262 WebInputEventResult passMouseMoveEventToSubframe(MouseEventWithHitTestResult
s&, LocalFrame* subframe, HitTestResult* hoveredNode = nullptr); |
| 304 WebInputEventResult passMouseReleaseEventToSubframe(MouseEventWithHitTestRes
ults&, LocalFrame* subframe); | 263 WebInputEventResult passMouseReleaseEventToSubframe(MouseEventWithHitTestRes
ults&, LocalFrame* subframe); |
| 305 | 264 |
| 306 bool passMousePressEventToScrollbar(MouseEventWithHitTestResults&); | 265 bool passMousePressEventToScrollbar(MouseEventWithHitTestResults&); |
| 307 | 266 |
| 308 void defaultSpaceEventHandler(KeyboardEvent*); | 267 void defaultSpaceEventHandler(KeyboardEvent*); |
| 309 void defaultBackspaceEventHandler(KeyboardEvent*); | 268 void defaultBackspaceEventHandler(KeyboardEvent*); |
| 310 void defaultTabEventHandler(KeyboardEvent*); | 269 void defaultTabEventHandler(KeyboardEvent*); |
| 311 void defaultEscapeEventHandler(KeyboardEvent*); | 270 void defaultEscapeEventHandler(KeyboardEvent*); |
| 312 void defaultArrowEventHandler(WebFocusType, KeyboardEvent*); | 271 void defaultArrowEventHandler(WebFocusType, KeyboardEvent*); |
| 313 | 272 |
| 314 void updateLastScrollbarUnderMouse(Scrollbar*, bool); | 273 void updateLastScrollbarUnderMouse(Scrollbar*, bool); |
| 315 | 274 |
| 316 bool capturesDragging() const { return m_capturesDragging; } | |
| 317 | |
| 318 WebInputEventResult handleGestureShowPress(); | 275 WebInputEventResult handleGestureShowPress(); |
| 319 | 276 |
| 320 void setLastKnownMousePosition(const PlatformMouseEvent&); | |
| 321 | |
| 322 void setClickNode(Node*); | |
| 323 bool handleDragDropIfPossible(const GestureEventWithHitTestResults&); | |
| 324 static ContainerNode* parentForClickEvent(const Node&); | |
| 325 | |
| 326 bool shouldTopControlsConsumeScroll(FloatSize) const; | 277 bool shouldTopControlsConsumeScroll(FloatSize) const; |
| 327 | 278 |
| 328 // If the given element is a shadow host and its root has delegatesFocus=fal
se flag, | |
| 329 // slide focus to its inner element. Returns true if the resulting focus is
different from | |
| 330 // the given element. | |
| 331 bool slideFocusOnShadowHostIfNecessary(const Element&); | |
| 332 | |
| 333 FrameHost* frameHost() const; | 279 FrameHost* frameHost() const; |
| 334 | 280 |
| 335 // NOTE: If adding a new field to this class please ensure that it is | 281 // NOTE: If adding a new field to this class please ensure that it is |
| 336 // cleared in |EventHandler::clear()|. | 282 // cleared in |EventHandler::clear()|. |
| 337 | 283 |
| 338 const Member<LocalFrame> m_frame; | 284 const Member<LocalFrame> m_frame; |
| 339 | 285 |
| 340 // Current button-press state for mouse/mouse-like-stylus. | |
| 341 // TODO(crbug.com/563676): Buggy for chorded buttons. | |
| 342 bool m_mousePressed; | |
| 343 | |
| 344 bool m_capturesDragging; | |
| 345 Member<Node> m_mousePressNode; | |
| 346 | |
| 347 bool m_mouseDownMayStartDrag; | |
| 348 const Member<SelectionController> m_selectionController; | 286 const Member<SelectionController> m_selectionController; |
| 349 | 287 |
| 350 LayoutPoint m_dragStartPos; | |
| 351 | |
| 352 Timer<EventHandler> m_hoverTimer; | 288 Timer<EventHandler> m_hoverTimer; |
| 353 | 289 |
| 354 // TODO(rbyers): Mouse cursor update is page-wide, not per-frame. Page-wide
state | 290 // TODO(rbyers): Mouse cursor update is page-wide, not per-frame. Page-wide
state |
| 355 // should move out of EventHandler to a new PageEventHandler class. crbug.co
m/449649 | 291 // should move out of EventHandler to a new PageEventHandler class. crbug.co
m/449649 |
| 356 Timer<EventHandler> m_cursorUpdateTimer; | 292 Timer<EventHandler> m_cursorUpdateTimer; |
| 357 | 293 |
| 358 bool m_mouseDownMayStartAutoscroll; | |
| 359 | |
| 360 Timer<EventHandler> m_fakeMouseMoveEventTimer; | |
| 361 | |
| 362 bool m_svgPan; | |
| 363 | |
| 364 Member<Node> m_capturingMouseEventsNode; | 294 Member<Node> m_capturingMouseEventsNode; |
| 365 bool m_eventHandlerWillResetCapturingMouseEventsNode; | 295 bool m_eventHandlerWillResetCapturingMouseEventsNode; |
| 366 | 296 |
| 367 // TODO(nzolghadr): Refactor the mouse related fields to MouseEventManager. | |
| 368 // Note the difference of this and m_nodeUnderPointer in PointerEventManager | |
| 369 Member<Node> m_nodeUnderMouse; | |
| 370 | 297 |
| 371 Member<LocalFrame> m_lastMouseMoveEventSubframe; | 298 Member<LocalFrame> m_lastMouseMoveEventSubframe; |
| 372 Member<Scrollbar> m_lastScrollbarUnderMouse; | 299 Member<Scrollbar> m_lastScrollbarUnderMouse; |
| 373 | 300 |
| 374 int m_clickCount; | |
| 375 Member<Node> m_clickNode; | |
| 376 | |
| 377 Member<Node> m_dragTarget; | 301 Member<Node> m_dragTarget; |
| 378 bool m_shouldOnlyFireDragOverEvent; | 302 bool m_shouldOnlyFireDragOverEvent; |
| 379 | 303 |
| 380 Member<HTMLFrameSetElement> m_frameSetBeingResized; | 304 Member<HTMLFrameSetElement> m_frameSetBeingResized; |
| 381 | 305 |
| 382 bool m_mousePositionIsUnknown; | |
| 383 // The last mouse movement position this frame has seen in root frame coordi
nates. | |
| 384 IntPoint m_lastKnownMousePosition; | |
| 385 IntPoint m_lastKnownMouseGlobalPosition; | |
| 386 IntPoint m_mouseDownPos; // In our view's coords. | |
| 387 double m_mouseDownTimestamp; | |
| 388 PlatformMouseEvent m_mouseDown; | |
| 389 RefPtr<UserGestureToken> m_lastMouseDownUserGestureToken; | 306 RefPtr<UserGestureToken> m_lastMouseDownUserGestureToken; |
| 390 | 307 |
| 391 Member<ScrollManager> m_scrollManager; | 308 Member<ScrollManager> m_scrollManager; |
| 392 Member<MouseEventManager> m_mouseEventManager; | 309 Member<MouseEventManager> m_mouseEventManager; |
| 393 Member<KeyboardEventManager> m_keyboardEventManager; | 310 Member<KeyboardEventManager> m_keyboardEventManager; |
| 394 Member<PointerEventManager> m_pointerEventManager; | 311 Member<PointerEventManager> m_pointerEventManager; |
| 395 Member<GestureManager> m_gestureManager; | 312 Member<GestureManager> m_gestureManager; |
| 396 | 313 |
| 397 double m_maxMouseMovedDuration; | 314 double m_maxMouseMovedDuration; |
| 398 | 315 |
| 399 bool m_longTapShouldInvokeContextMenu; | 316 bool m_longTapShouldInvokeContextMenu; |
| 400 | 317 |
| 401 Timer<EventHandler> m_activeIntervalTimer; | 318 Timer<EventHandler> m_activeIntervalTimer; |
| 402 double m_lastShowPressTimestamp; | 319 double m_lastShowPressTimestamp; |
| 403 Member<Element> m_lastDeferredTapElement; | 320 Member<Element> m_lastDeferredTapElement; |
| 404 | 321 |
| 405 // Set on GestureTapDown if the |pointerdown| event corresponding to the | 322 // Set on GestureTapDown if the |pointerdown| event corresponding to the |
| 406 // triggering |touchstart| event was canceled. This suppresses mouse event | 323 // triggering |touchstart| event was canceled. This suppresses mouse event |
| 407 // firing for the current gesture sequence (i.e. until next GestureTapDown). | 324 // firing for the current gesture sequence (i.e. until next GestureTapDown). |
| 408 bool m_suppressMouseEventsFromGestures; | 325 bool m_suppressMouseEventsFromGestures; |
| 409 | 326 |
| 410 // TODO(nzolghadr): Temporary until further refactoring | |
| 411 friend GestureManager; | |
| 412 }; | 327 }; |
| 413 | 328 |
| 414 } // namespace blink | 329 } // namespace blink |
| 415 | 330 |
| 416 #endif // EventHandler_h | 331 #endif // EventHandler_h |
| OLD | NEW |