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