| 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 12 matching lines...) Expand all Loading... |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef EventHandler_h | 26 #ifndef EventHandler_h |
| 27 #define EventHandler_h | 27 #define EventHandler_h |
| 28 | 28 |
| 29 #include "core/CoreExport.h" | 29 #include "core/CoreExport.h" |
| 30 #include "core/events/TextEventInputType.h" | 30 #include "core/events/TextEventInputType.h" |
| 31 #include "core/input/GestureManager.h" | 31 #include "core/input/GestureManager.h" |
| 32 #include "core/input/KeyboardEventManager.h" | 32 #include "core/input/KeyboardEventManager.h" |
| 33 #include "core/input/MouseEventManager.h" |
| 33 #include "core/input/PointerEventManager.h" | 34 #include "core/input/PointerEventManager.h" |
| 34 #include "core/input/ScrollManager.h" | 35 #include "core/input/ScrollManager.h" |
| 35 #include "core/layout/HitTestRequest.h" | 36 #include "core/layout/HitTestRequest.h" |
| 36 #include "core/page/DragActions.h" | 37 #include "core/page/DragActions.h" |
| 37 #include "core/page/EventWithHitTestResults.h" | 38 #include "core/page/EventWithHitTestResults.h" |
| 38 #include "core/style/ComputedStyleConstants.h" | 39 #include "core/style/ComputedStyleConstants.h" |
| 39 #include "platform/Cursor.h" | 40 #include "platform/Cursor.h" |
| 40 #include "platform/PlatformMouseEvent.h" | 41 #include "platform/PlatformMouseEvent.h" |
| 41 #include "platform/PlatformTouchPoint.h" | 42 #include "platform/PlatformTouchPoint.h" |
| 42 #include "platform/Timer.h" | 43 #include "platform/Timer.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // TODO(nzolghadr): Some of the APIs in this class only forward the action | 105 // TODO(nzolghadr): Some of the APIs in this class only forward the action |
| 105 // to the corresponding Manager class. We need to investigate whether it is | 106 // to the corresponding Manager class. We need to investigate whether it is |
| 106 // better to expose the manager instance itself later or can the access to | 107 // better to expose the manager instance itself later or can the access to |
| 107 // those APIs be more limited or removed. | 108 // those APIs be more limited or removed. |
| 108 | 109 |
| 109 void stopAutoscroll(); | 110 void stopAutoscroll(); |
| 110 | 111 |
| 111 void dispatchFakeMouseMoveEventSoon(); | 112 void dispatchFakeMouseMoveEventSoon(); |
| 112 void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&); | 113 void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&); |
| 113 | 114 |
| 114 static HitTestResult hitTestResultInFrame(LocalFrame*, const LayoutPoint&, H
itTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRe
quest::Active); | |
| 115 | |
| 116 HitTestResult hitTestResultAtPoint(const LayoutPoint&, | 115 HitTestResult hitTestResultAtPoint(const LayoutPoint&, |
| 117 HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly |
HitTestRequest::Active, | 116 HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly |
HitTestRequest::Active, |
| 118 const LayoutSize& padding = LayoutSize()); | 117 const LayoutSize& padding = LayoutSize()); |
| 119 | 118 |
| 120 bool mousePressed() const { return m_mousePressed; } | 119 bool mousePressed() const { return m_mousePressed; } |
| 121 | 120 |
| 122 void setCapturingMouseEventsNode(Node*); // A caller is responsible for rese
tting capturing node to 0. | 121 void setCapturingMouseEventsNode(Node*); // A caller is responsible for rese
tting capturing node to 0. |
| 123 | 122 |
| 124 WebInputEventResult updateDragAndDrop(const PlatformMouseEvent&, DataTransfe
r*); | 123 WebInputEventResult updateDragAndDrop(const PlatformMouseEvent&, DataTransfe
r*); |
| 125 void cancelDragAndDrop(const PlatformMouseEvent&, DataTransfer*); | 124 void cancelDragAndDrop(const PlatformMouseEvent&, DataTransfer*); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 185 |
| 187 void setPointerCapture(int, EventTarget*); | 186 void setPointerCapture(int, EventTarget*); |
| 188 void releasePointerCapture(int, EventTarget*); | 187 void releasePointerCapture(int, EventTarget*); |
| 189 bool hasPointerCapture(int, const EventTarget*) const; | 188 bool hasPointerCapture(int, const EventTarget*) const; |
| 190 bool hasProcessedPointerCapture(int, const EventTarget*) const; | 189 bool hasProcessedPointerCapture(int, const EventTarget*) const; |
| 191 | 190 |
| 192 void elementRemoved(EventTarget*); | 191 void elementRemoved(EventTarget*); |
| 193 | 192 |
| 194 void setMouseDownMayStartAutoscroll() { m_mouseDownMayStartAutoscroll = true
; } | 193 void setMouseDownMayStartAutoscroll() { m_mouseDownMayStartAutoscroll = true
; } |
| 195 | 194 |
| 196 static WebInputEventResult mergeEventResult(WebInputEventResult resultA, Web
InputEventResult resultB); | |
| 197 static WebInputEventResult toWebInputEventResult(DispatchEventResult); | |
| 198 | |
| 199 bool handleAccessKey(const PlatformKeyboardEvent&); | 195 bool handleAccessKey(const PlatformKeyboardEvent&); |
| 200 WebInputEventResult keyEvent(const PlatformKeyboardEvent&); | 196 WebInputEventResult keyEvent(const PlatformKeyboardEvent&); |
| 201 void defaultKeyboardEventHandler(KeyboardEvent*); | 197 void defaultKeyboardEventHandler(KeyboardEvent*); |
| 202 | 198 |
| 203 bool handleTextInputEvent(const String& text, Event* underlyingEvent = nullp
tr, TextEventInputType = TextEventInputKeyboard); | 199 bool handleTextInputEvent(const String& text, Event* underlyingEvent = nullp
tr, TextEventInputType = TextEventInputKeyboard); |
| 204 void defaultTextInputEventHandler(TextEvent*); | 200 void defaultTextInputEventHandler(TextEvent*); |
| 205 | 201 |
| 206 void dragSourceEndedAt(const PlatformMouseEvent&, DragOperation); | 202 void dragSourceEndedAt(const PlatformMouseEvent&, DragOperation); |
| 207 | 203 |
| 208 void focusDocumentView(); | 204 void focusDocumentView(); |
| 209 | 205 |
| 210 void capsLockStateMayHaveChanged(); // Only called by FrameSelection | 206 void capsLockStateMayHaveChanged(); // Only called by FrameSelection |
| 211 | 207 |
| 212 WebInputEventResult handleTouchEvent(const PlatformTouchEvent&); | 208 WebInputEventResult handleTouchEvent(const PlatformTouchEvent&); |
| 213 | 209 |
| 214 bool useHandCursor(Node*, bool isOverLink); | 210 bool useHandCursor(Node*, bool isOverLink); |
| 215 | 211 |
| 216 void notifyElementActivated(); | 212 void notifyElementActivated(); |
| 217 | 213 |
| 218 PassRefPtr<UserGestureToken> takeLastMouseDownGestureToken() { return m_last
MouseDownUserGestureToken.release(); } | 214 PassRefPtr<UserGestureToken> takeLastMouseDownGestureToken() { return m_last
MouseDownUserGestureToken.release(); } |
| 219 | 215 |
| 220 int clickCount() { return m_clickCount; } | |
| 221 | |
| 222 SelectionController& selectionController() const { return *m_selectionContro
ller; } | 216 SelectionController& selectionController() const { return *m_selectionContro
ller; } |
| 223 | 217 |
| 224 // FIXME(nzolghadr): This function is technically a private function of | 218 // FIXME(nzolghadr): This function is technically a private function of |
| 225 // EventHandler class. Making it public temporary to make it possible to | 219 // EventHandler class. Making it public temporary to make it possible to |
| 226 // move some code around in the refactoring process. | 220 // move some code around in the refactoring process. |
| 227 // Performs a chaining logical scroll, within a *single* frame, starting | 221 // Performs a chaining logical scroll, within a *single* frame, starting |
| 228 // from either a provided starting node or a default based on the focused or | 222 // from either a provided starting node or a default based on the focused or |
| 229 // most recently clicked node, falling back to the frame. | 223 // most recently clicked node, falling back to the frame. |
| 230 // Returns true if the scroll was consumed. | 224 // Returns true if the scroll was consumed. |
| 231 // direction - The logical direction to scroll in. This will be converted to | 225 // direction - The logical direction to scroll in. This will be converted to |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 | 383 |
| 390 bool m_mousePositionIsUnknown; | 384 bool m_mousePositionIsUnknown; |
| 391 // The last mouse movement position this frame has seen in root frame coordi
nates. | 385 // The last mouse movement position this frame has seen in root frame coordi
nates. |
| 392 IntPoint m_lastKnownMousePosition; | 386 IntPoint m_lastKnownMousePosition; |
| 393 IntPoint m_lastKnownMouseGlobalPosition; | 387 IntPoint m_lastKnownMouseGlobalPosition; |
| 394 IntPoint m_mouseDownPos; // In our view's coords. | 388 IntPoint m_mouseDownPos; // In our view's coords. |
| 395 double m_mouseDownTimestamp; | 389 double m_mouseDownTimestamp; |
| 396 PlatformMouseEvent m_mouseDown; | 390 PlatformMouseEvent m_mouseDown; |
| 397 RefPtr<UserGestureToken> m_lastMouseDownUserGestureToken; | 391 RefPtr<UserGestureToken> m_lastMouseDownUserGestureToken; |
| 398 | 392 |
| 393 ScrollManager m_scrollManager; |
| 394 MouseEventManager m_mouseEventManager; |
| 395 KeyboardEventManager m_keyboardEventManager; |
| 399 PointerEventManager m_pointerEventManager; | 396 PointerEventManager m_pointerEventManager; |
| 400 ScrollManager m_scrollManager; | |
| 401 KeyboardEventManager m_keyboardEventManager; | |
| 402 GestureManager m_gestureManager; | 397 GestureManager m_gestureManager; |
| 403 | 398 |
| 404 double m_maxMouseMovedDuration; | 399 double m_maxMouseMovedDuration; |
| 405 | 400 |
| 406 bool m_longTapShouldInvokeContextMenu; | 401 bool m_longTapShouldInvokeContextMenu; |
| 407 | 402 |
| 408 Timer<EventHandler> m_activeIntervalTimer; | 403 Timer<EventHandler> m_activeIntervalTimer; |
| 409 double m_lastShowPressTimestamp; | 404 double m_lastShowPressTimestamp; |
| 410 Member<Element> m_lastDeferredTapElement; | 405 Member<Element> m_lastDeferredTapElement; |
| 411 | 406 |
| 412 // Set on GestureTapDown if the |pointerdown| event corresponding to the | 407 // Set on GestureTapDown if the |pointerdown| event corresponding to the |
| 413 // triggering |touchstart| event was canceled. This suppresses mouse event | 408 // triggering |touchstart| event was canceled. This suppresses mouse event |
| 414 // firing for the current gesture sequence (i.e. until next GestureTapDown). | 409 // firing for the current gesture sequence (i.e. until next GestureTapDown). |
| 415 bool m_suppressMouseEventsFromGestures; | 410 bool m_suppressMouseEventsFromGestures; |
| 416 | 411 |
| 417 // TODO(nzolghadr): Temporary until further refactoring | 412 // TODO(nzolghadr): Temporary until further refactoring |
| 418 friend GestureManager; | 413 friend GestureManager; |
| 419 }; | 414 }; |
| 420 | 415 |
| 421 } // namespace blink | 416 } // namespace blink |
| 422 | 417 |
| 423 #endif // EventHandler_h | 418 #endif // EventHandler_h |
| OLD | NEW |