| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 bool isPointerEventActive(int); | 184 bool isPointerEventActive(int); |
| 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, EventTarget*); | 188 bool hasPointerCapture(int, EventTarget*); |
| 190 | 189 |
| 191 void elementRemoved(EventTarget*); | 190 void elementRemoved(EventTarget*); |
| 192 | 191 |
| 193 void setMouseDownMayStartAutoscroll() { m_mouseDownMayStartAutoscroll = true
; } | 192 void setMouseDownMayStartAutoscroll() { m_mouseDownMayStartAutoscroll = true
; } |
| 194 | 193 |
| 195 static WebInputEventResult mergeEventResult(WebInputEventResult resultA, Web
InputEventResult resultB); | |
| 196 static WebInputEventResult toWebInputEventResult(DispatchEventResult); | |
| 197 | |
| 198 bool handleAccessKey(const PlatformKeyboardEvent&); | 194 bool handleAccessKey(const PlatformKeyboardEvent&); |
| 199 WebInputEventResult keyEvent(const PlatformKeyboardEvent&); | 195 WebInputEventResult keyEvent(const PlatformKeyboardEvent&); |
| 200 void defaultKeyboardEventHandler(KeyboardEvent*); | 196 void defaultKeyboardEventHandler(KeyboardEvent*); |
| 201 | 197 |
| 202 bool handleTextInputEvent(const String& text, Event* underlyingEvent = nullp
tr, TextEventInputType = TextEventInputKeyboard); | 198 bool handleTextInputEvent(const String& text, Event* underlyingEvent = nullp
tr, TextEventInputType = TextEventInputKeyboard); |
| 203 void defaultTextInputEventHandler(TextEvent*); | 199 void defaultTextInputEventHandler(TextEvent*); |
| 204 | 200 |
| 205 void dragSourceEndedAt(const PlatformMouseEvent&, DragOperation); | 201 void dragSourceEndedAt(const PlatformMouseEvent&, DragOperation); |
| 206 | 202 |
| 207 void focusDocumentView(); | 203 void focusDocumentView(); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 384 |
| 389 bool m_mousePositionIsUnknown; | 385 bool m_mousePositionIsUnknown; |
| 390 // The last mouse movement position this frame has seen in root frame coordi
nates. | 386 // The last mouse movement position this frame has seen in root frame coordi
nates. |
| 391 IntPoint m_lastKnownMousePosition; | 387 IntPoint m_lastKnownMousePosition; |
| 392 IntPoint m_lastKnownMouseGlobalPosition; | 388 IntPoint m_lastKnownMouseGlobalPosition; |
| 393 IntPoint m_mouseDownPos; // In our view's coords. | 389 IntPoint m_mouseDownPos; // In our view's coords. |
| 394 double m_mouseDownTimestamp; | 390 double m_mouseDownTimestamp; |
| 395 PlatformMouseEvent m_mouseDown; | 391 PlatformMouseEvent m_mouseDown; |
| 396 RefPtr<UserGestureToken> m_lastMouseDownUserGestureToken; | 392 RefPtr<UserGestureToken> m_lastMouseDownUserGestureToken; |
| 397 | 393 |
| 394 GestureManager m_gestureManager; |
| 395 MouseEventManager m_mouseEventManager; |
| 398 PointerEventManager m_pointerEventManager; | 396 PointerEventManager m_pointerEventManager; |
| 399 ScrollManager m_scrollManager; | 397 ScrollManager m_scrollManager; |
| 400 KeyboardEventManager m_keyboardEventManager; | 398 KeyboardEventManager m_keyboardEventManager; |
| 401 GestureManager m_gestureManager; | |
| 402 | 399 |
| 403 double m_maxMouseMovedDuration; | 400 double m_maxMouseMovedDuration; |
| 404 | 401 |
| 405 bool m_longTapShouldInvokeContextMenu; | 402 bool m_longTapShouldInvokeContextMenu; |
| 406 | 403 |
| 407 Timer<EventHandler> m_activeIntervalTimer; | 404 Timer<EventHandler> m_activeIntervalTimer; |
| 408 double m_lastShowPressTimestamp; | 405 double m_lastShowPressTimestamp; |
| 409 Member<Element> m_lastDeferredTapElement; | 406 Member<Element> m_lastDeferredTapElement; |
| 410 | 407 |
| 411 // Set on GestureTapDown if the |pointerdown| event corresponding to the | 408 // Set on GestureTapDown if the |pointerdown| event corresponding to the |
| 412 // triggering |touchstart| event was canceled. This suppresses mouse event | 409 // triggering |touchstart| event was canceled. This suppresses mouse event |
| 413 // firing for the current gesture sequence (i.e. until next GestureTapDown). | 410 // firing for the current gesture sequence (i.e. until next GestureTapDown). |
| 414 bool m_suppressMouseEventsFromGestures; | 411 bool m_suppressMouseEventsFromGestures; |
| 415 | 412 |
| 416 // TODO(nzolghadr): Temporary until further refactoring | 413 // TODO(nzolghadr): Temporary until further refactoring |
| 417 friend GestureManager; | 414 friend GestureManager; |
| 418 }; | 415 }; |
| 419 | 416 |
| 420 } // namespace blink | 417 } // namespace blink |
| 421 | 418 |
| 422 #endif // EventHandler_h | 419 #endif // EventHandler_h |
| OLD | NEW |