| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 bool useHandCursor(Node*, bool isOverLink); | 194 bool useHandCursor(Node*, bool isOverLink); |
| 195 | 195 |
| 196 void notifyElementActivated(); | 196 void notifyElementActivated(); |
| 197 | 197 |
| 198 PassRefPtr<UserGestureToken> takeLastMouseDownGestureToken() { return m_last
MouseDownUserGestureToken.release(); } | 198 PassRefPtr<UserGestureToken> takeLastMouseDownGestureToken() { return m_last
MouseDownUserGestureToken.release(); } |
| 199 | 199 |
| 200 int clickCount() { return m_clickCount; } | 200 int clickCount() { return m_clickCount; } |
| 201 | 201 |
| 202 SelectionController& selectionController() const { return *m_selectionContro
ller; } | 202 SelectionController& selectionController() const { return *m_selectionContro
ller; } |
| 203 | 203 |
| 204 class TouchInfo { |
| 205 ALLOW_ONLY_INLINE_ALLOCATION(); |
| 206 public: |
| 207 DEFINE_INLINE_TRACE() |
| 208 { |
| 209 visitor->trace(touchTarget); |
| 210 visitor->trace(targetFrame); |
| 211 } |
| 212 |
| 213 PlatformTouchPoint point; |
| 214 RefPtrWillBeMember<EventTarget> touchTarget; |
| 215 RefPtrWillBeMember<LocalFrame> targetFrame; |
| 216 FloatPoint adjustedPagePoint; |
| 217 FloatSize adjustedRadius; |
| 218 bool knownTarget; |
| 219 bool consumed; |
| 220 }; |
| 221 |
| 204 private: | 222 private: |
| 205 static DragState& dragState(); | 223 static DragState& dragState(); |
| 206 | 224 |
| 207 DataTransfer* createDraggingDataTransfer() const; | 225 DataTransfer* createDraggingDataTransfer() const; |
| 208 | 226 |
| 209 bool handleMouseMoveOrLeaveEvent(const PlatformMouseEvent&, HitTestResult* h
overedNode = nullptr, bool onlyUpdateScrollbars = false, bool forceLeave = false
); | 227 bool handleMouseMoveOrLeaveEvent(const PlatformMouseEvent&, HitTestResult* h
overedNode = nullptr, bool onlyUpdateScrollbars = false, bool forceLeave = false
); |
| 210 bool handleMousePressEvent(const MouseEventWithHitTestResults&); | 228 bool handleMousePressEvent(const MouseEventWithHitTestResults&); |
| 211 bool handleMouseFocus(const MouseEventWithHitTestResults&); | 229 bool handleMouseFocus(const MouseEventWithHitTestResults&); |
| 212 bool handleMouseDraggedEvent(const MouseEventWithHitTestResults&); | 230 bool handleMouseDraggedEvent(const MouseEventWithHitTestResults&); |
| 213 bool handleMouseReleaseEvent(const MouseEventWithHitTestResults&); | 231 bool handleMouseReleaseEvent(const MouseEventWithHitTestResults&); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 bool panScrollInProgress() const; | 329 bool panScrollInProgress() const; |
| 312 void setLastKnownMousePosition(const PlatformMouseEvent&); | 330 void setLastKnownMousePosition(const PlatformMouseEvent&); |
| 313 | 331 |
| 314 bool shouldTopControlsConsumeScroll(FloatSize) const; | 332 bool shouldTopControlsConsumeScroll(FloatSize) const; |
| 315 | 333 |
| 316 // If the given element is a shadow host and its root has delegatesFocus=fal
se flag, | 334 // If the given element is a shadow host and its root has delegatesFocus=fal
se flag, |
| 317 // slide focus to its inner element. Returns true if the resulting focus is
different from | 335 // slide focus to its inner element. Returns true if the resulting focus is
different from |
| 318 // the given element. | 336 // the given element. |
| 319 bool slideFocusOnShadowHostIfNecessary(const Element&); | 337 bool slideFocusOnShadowHostIfNecessary(const Element&); |
| 320 | 338 |
| 321 using TouchInfo = struct { | 339 void dispatchPointerEventsForTouchEvent(const PlatformTouchEvent&, WillBeHea
pVector<TouchInfo>&); |
| 322 PlatformTouchPoint point; | 340 bool dispatchTouchEvents(const PlatformTouchEvent&, WillBeHeapVector<TouchIn
fo>&, bool, bool); |
| 323 EventTarget* touchTarget; | |
| 324 LocalFrame* targetFrame; | |
| 325 FloatPoint adjustedPagePoint; | |
| 326 FloatSize adjustedRadius; | |
| 327 bool knownTarget; | |
| 328 bool consumed; | |
| 329 }; | |
| 330 | |
| 331 void dispatchPointerEventsForTouchEvent(const PlatformTouchEvent&, Vector<To
uchInfo>&); | |
| 332 bool dispatchTouchEvents(const PlatformTouchEvent&, Vector<TouchInfo>&, bool
, bool); | |
| 333 | 341 |
| 334 // NOTE: If adding a new field to this class please ensure that it is | 342 // NOTE: If adding a new field to this class please ensure that it is |
| 335 // cleared in |EventHandler::clear()|. | 343 // cleared in |EventHandler::clear()|. |
| 336 | 344 |
| 337 LocalFrame* const m_frame; | 345 LocalFrame* const m_frame; |
| 338 | 346 |
| 339 bool m_mousePressed; | 347 bool m_mousePressed; |
| 340 bool m_capturesDragging; | 348 bool m_capturesDragging; |
| 341 RefPtrWillBeMember<Node> m_mousePressNode; | 349 RefPtrWillBeMember<Node> m_mousePressNode; |
| 342 | 350 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 // True iff some of the delta has been consumed for the current | 435 // True iff some of the delta has been consumed for the current |
| 428 // scroll sequence in this frame, or any child frames. Only used | 436 // scroll sequence in this frame, or any child frames. Only used |
| 429 // with ScrollCustomization. If some delta has been consumed, a | 437 // with ScrollCustomization. If some delta has been consumed, a |
| 430 // scroll which shouldn't propagate can't cause any element to | 438 // scroll which shouldn't propagate can't cause any element to |
| 431 // scroll other than the |m_previousGestureScrolledNode|. | 439 // scroll other than the |m_previousGestureScrolledNode|. |
| 432 bool m_deltaConsumedForScrollSequence; | 440 bool m_deltaConsumedForScrollSequence; |
| 433 }; | 441 }; |
| 434 | 442 |
| 435 } // namespace blink | 443 } // namespace blink |
| 436 | 444 |
| 445 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::EventHandler::TouchInfo); |
| 446 |
| 437 #endif // EventHandler_h | 447 #endif // EventHandler_h |
| OLD | NEW |