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 26 matching lines...) Expand all Loading... |
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/UserGestureIndicator.h" | 43 #include "platform/UserGestureIndicator.h" |
44 #include "platform/geometry/LayoutPoint.h" | 44 #include "platform/geometry/LayoutPoint.h" |
45 #include "platform/heap/Handle.h" | 45 #include "platform/heap/Handle.h" |
46 #include "platform/scroll/ScrollTypes.h" | 46 #include "platform/scroll/ScrollTypes.h" |
| 47 #include "public/platform/WebGestureEvent.h" |
47 #include "public/platform/WebInputEvent.h" | 48 #include "public/platform/WebInputEvent.h" |
48 #include "public/platform/WebInputEventResult.h" | 49 #include "public/platform/WebInputEventResult.h" |
49 #include "wtf/Forward.h" | 50 #include "wtf/Forward.h" |
50 #include "wtf/HashMap.h" | 51 #include "wtf/HashMap.h" |
51 #include "wtf/HashTraits.h" | 52 #include "wtf/HashTraits.h" |
52 #include "wtf/RefPtr.h" | 53 #include "wtf/RefPtr.h" |
53 | 54 |
54 namespace blink { | 55 namespace blink { |
55 | 56 |
56 class ContainerNode; | 57 class ContainerNode; |
57 class DataTransfer; | 58 class DataTransfer; |
58 class PaintLayer; | 59 class PaintLayer; |
59 class Element; | 60 class Element; |
60 class Event; | 61 class Event; |
61 class EventTarget; | 62 class EventTarget; |
62 template <typename EventType> | 63 template <typename EventType> |
63 class EventWithHitTestResults; | 64 class EventWithHitTestResults; |
64 class FloatQuad; | 65 class FloatQuad; |
65 class FrameHost; | 66 class FrameHost; |
66 class HTMLFrameSetElement; | 67 class HTMLFrameSetElement; |
67 class HitTestRequest; | 68 class HitTestRequest; |
68 class HitTestResult; | 69 class HitTestResult; |
69 class LayoutObject; | 70 class LayoutObject; |
70 class LocalFrame; | 71 class LocalFrame; |
71 class Node; | 72 class Node; |
72 class OptionalCursor; | 73 class OptionalCursor; |
73 class PlatformGestureEvent; | |
74 class PlatformTouchEvent; | 74 class PlatformTouchEvent; |
75 class PlatformWheelEvent; | 75 class PlatformWheelEvent; |
76 class ScrollableArea; | 76 class ScrollableArea; |
77 class Scrollbar; | 77 class Scrollbar; |
78 class SelectionController; | 78 class SelectionController; |
79 class TextEvent; | 79 class TextEvent; |
80 class WheelEvent; | 80 class WheelEvent; |
81 | 81 |
82 class CORE_EXPORT EventHandler final | 82 class CORE_EXPORT EventHandler final |
83 : public GarbageCollectedFinalized<EventHandler> { | 83 : public GarbageCollectedFinalized<EventHandler> { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 WebInputEventResult handleMouseMoveEvent( | 144 WebInputEventResult handleMouseMoveEvent( |
145 const PlatformMouseEvent&, | 145 const PlatformMouseEvent&, |
146 const Vector<PlatformMouseEvent>& coalescedEvents); | 146 const Vector<PlatformMouseEvent>& coalescedEvents); |
147 void handleMouseLeaveEvent(const PlatformMouseEvent&); | 147 void handleMouseLeaveEvent(const PlatformMouseEvent&); |
148 | 148 |
149 WebInputEventResult handleMousePressEvent(const PlatformMouseEvent&); | 149 WebInputEventResult handleMousePressEvent(const PlatformMouseEvent&); |
150 WebInputEventResult handleMouseReleaseEvent(const PlatformMouseEvent&); | 150 WebInputEventResult handleMouseReleaseEvent(const PlatformMouseEvent&); |
151 WebInputEventResult handleWheelEvent(const PlatformWheelEvent&); | 151 WebInputEventResult handleWheelEvent(const PlatformWheelEvent&); |
152 | 152 |
153 // Called on the local root frame exactly once per gesture event. | 153 // Called on the local root frame exactly once per gesture event. |
154 WebInputEventResult handleGestureEvent(const PlatformGestureEvent&); | 154 WebInputEventResult handleGestureEvent(const WebGestureEvent&); |
155 WebInputEventResult handleGestureEvent(const GestureEventWithHitTestResults&); | 155 WebInputEventResult handleGestureEvent(const GestureEventWithHitTestResults&); |
156 | 156 |
157 // Clear the old hover/active state within frames before moving the hover | 157 // Clear the old hover/active state within frames before moving the hover |
158 // state to the another frame | 158 // state to the another frame |
159 void updateGestureHoverActiveState(const HitTestRequest&, Element*); | 159 void updateGestureHoverActiveState(const HitTestRequest&, Element*); |
160 | 160 |
161 // Hit-test the provided (non-scroll) gesture event, applying touch-adjustment | 161 // Hit-test the provided (non-scroll) gesture event, applying touch-adjustment |
162 // and updating hover/active state across all frames if necessary. This should | 162 // and updating hover/active state across all frames if necessary. This should |
163 // be called at most once per gesture event, and called on the local root | 163 // be called at most once per gesture event, and called on the local root |
164 // frame. | 164 // frame. |
165 // Note: This is similar to (the less clearly named) prepareMouseEvent. | 165 // Note: This is similar to (the less clearly named) prepareMouseEvent. |
166 // FIXME: Remove readOnly param when there is only ever a single call to this. | 166 // FIXME: Remove readOnly param when there is only ever a single call to this. |
167 GestureEventWithHitTestResults targetGestureEvent(const PlatformGestureEvent&, | 167 GestureEventWithHitTestResults targetGestureEvent(const WebGestureEvent&, |
168 bool readOnly = false); | 168 bool readOnly = false); |
169 GestureEventWithHitTestResults hitTestResultForGestureEvent( | 169 GestureEventWithHitTestResults hitTestResultForGestureEvent( |
170 const PlatformGestureEvent&, | 170 const WebGestureEvent&, |
171 HitTestRequest::HitTestRequestType); | 171 HitTestRequest::HitTestRequestType); |
172 // Handle the provided non-scroll gesture event. Should be called only on the | 172 // Handle the provided non-scroll gesture event. Should be called only on the |
173 // inner frame. | 173 // inner frame. |
174 WebInputEventResult handleGestureEventInFrame( | 174 WebInputEventResult handleGestureEventInFrame( |
175 const GestureEventWithHitTestResults&); | 175 const GestureEventWithHitTestResults&); |
176 | 176 |
177 // Handle the provided scroll gesture event, propagating down to child frames | 177 // Handle the provided scroll gesture event, propagating down to child frames |
178 // as necessary. | 178 // as necessary. |
179 WebInputEventResult handleGestureScrollEvent(const PlatformGestureEvent&); | 179 WebInputEventResult handleGestureScrollEvent(const WebGestureEvent&); |
180 WebInputEventResult handleGestureScrollEnd(const PlatformGestureEvent&); | 180 WebInputEventResult handleGestureScrollEnd(const WebGestureEvent&); |
181 bool isScrollbarHandlingGestures() const; | 181 bool isScrollbarHandlingGestures() const; |
182 | 182 |
183 bool bestClickableNodeForHitTestResult(const HitTestResult&, | 183 bool bestClickableNodeForHitTestResult(const HitTestResult&, |
184 IntPoint& targetPoint, | 184 IntPoint& targetPoint, |
185 Node*& targetNode); | 185 Node*& targetNode); |
186 bool bestContextMenuNodeForHitTestResult(const HitTestResult&, | 186 bool bestContextMenuNodeForHitTestResult(const HitTestResult&, |
187 IntPoint& targetPoint, | 187 IntPoint& targetPoint, |
188 Node*& targetNode); | 188 Node*& targetNode); |
189 // FIXME: This doesn't appear to be used outside tests anymore, what path are | 189 // FIXME: This doesn't appear to be used outside tests anymore, what path are |
190 // we using now and is it tested? | 190 // we using now and is it tested? |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 private: | 261 private: |
262 WebInputEventResult handleMouseMoveOrLeaveEvent( | 262 WebInputEventResult handleMouseMoveOrLeaveEvent( |
263 const PlatformMouseEvent&, | 263 const PlatformMouseEvent&, |
264 const Vector<PlatformMouseEvent>&, | 264 const Vector<PlatformMouseEvent>&, |
265 HitTestResult* hoveredNode = nullptr, | 265 HitTestResult* hoveredNode = nullptr, |
266 bool onlyUpdateScrollbars = false, | 266 bool onlyUpdateScrollbars = false, |
267 bool forceLeave = false); | 267 bool forceLeave = false); |
268 | 268 |
269 HitTestRequest::HitTestRequestType getHitTypeForGestureType( | 269 HitTestRequest::HitTestRequestType getHitTypeForGestureType( |
270 PlatformEvent::EventType); | 270 PlatformEvent::EventType); |
271 void applyTouchAdjustment(PlatformGestureEvent*, HitTestResult*); | 271 void applyTouchAdjustment(WebGestureEvent*, HitTestResult*); |
272 WebInputEventResult handleGestureTapDown( | 272 WebInputEventResult handleGestureTapDown( |
273 const GestureEventWithHitTestResults&); | 273 const GestureEventWithHitTestResults&); |
274 WebInputEventResult handleGestureTap(const GestureEventWithHitTestResults&); | 274 WebInputEventResult handleGestureTap(const GestureEventWithHitTestResults&); |
275 WebInputEventResult handleGestureLongPress( | 275 WebInputEventResult handleGestureLongPress( |
276 const GestureEventWithHitTestResults&); | 276 const GestureEventWithHitTestResults&); |
277 WebInputEventResult handleGestureLongTap( | 277 WebInputEventResult handleGestureLongTap( |
278 const GestureEventWithHitTestResults&); | 278 const GestureEventWithHitTestResults&); |
279 | 279 |
280 void updateGestureTargetNodeForMouseEvent( | 280 void updateGestureTargetNodeForMouseEvent( |
281 const GestureEventWithHitTestResults&); | 281 const GestureEventWithHitTestResults&); |
282 | 282 |
283 bool shouldApplyTouchAdjustment(const PlatformGestureEvent&) const; | 283 bool shouldApplyTouchAdjustment(const WebGestureEvent&) const; |
284 | 284 |
285 OptionalCursor selectCursor(const HitTestResult&); | 285 OptionalCursor selectCursor(const HitTestResult&); |
286 OptionalCursor selectAutoCursor(const HitTestResult&, | 286 OptionalCursor selectAutoCursor(const HitTestResult&, |
287 Node*, | 287 Node*, |
288 const Cursor& iBeam); | 288 const Cursor& iBeam); |
289 | 289 |
290 void hoverTimerFired(TimerBase*); | 290 void hoverTimerFired(TimerBase*); |
291 void cursorUpdateTimerFired(TimerBase*); | 291 void cursorUpdateTimerFired(TimerBase*); |
292 void activeIntervalTimerFired(TimerBase*); | 292 void activeIntervalTimerFired(TimerBase*); |
293 | 293 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 | 387 |
388 // Set on GestureTapDown if the |pointerdown| event corresponding to the | 388 // Set on GestureTapDown if the |pointerdown| event corresponding to the |
389 // triggering |touchstart| event was canceled. This suppresses mouse event | 389 // triggering |touchstart| event was canceled. This suppresses mouse event |
390 // firing for the current gesture sequence (i.e. until next GestureTapDown). | 390 // firing for the current gesture sequence (i.e. until next GestureTapDown). |
391 bool m_suppressMouseEventsFromGestures; | 391 bool m_suppressMouseEventsFromGestures; |
392 }; | 392 }; |
393 | 393 |
394 } // namespace blink | 394 } // namespace blink |
395 | 395 |
396 #endif // EventHandler_h | 396 #endif // EventHandler_h |
OLD | NEW |