| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PointerEventManager_h | 5 #ifndef PointerEventManager_h |
| 6 #define PointerEventManager_h | 6 #define PointerEventManager_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/events/PointerEvent.h" | 9 #include "core/events/PointerEvent.h" |
| 10 #include "core/events/PointerEventFactory.h" | 10 #include "core/events/PointerEventFactory.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 PassRefPtrWillBeRawPtr<AbstractView>, | 32 PassRefPtrWillBeRawPtr<AbstractView>, |
| 33 PassRefPtrWillBeRawPtr<Node> lastNodeUnderMouse); | 33 PassRefPtrWillBeRawPtr<Node> lastNodeUnderMouse); |
| 34 | 34 |
| 35 // Returns whether the event is consumed or not | 35 // Returns whether the event is consumed or not |
| 36 WebInputEventResult sendTouchPointerEvent( | 36 WebInputEventResult sendTouchPointerEvent( |
| 37 PassRefPtrWillBeRawPtr<EventTarget>, | 37 PassRefPtrWillBeRawPtr<EventTarget>, |
| 38 const PlatformTouchPoint&, PlatformEvent::Modifiers, | 38 const PlatformTouchPoint&, PlatformEvent::Modifiers, |
| 39 const double width, const double height, | 39 const double width, const double height, |
| 40 const double clientX, const double clientY); | 40 const double clientX, const double clientY); |
| 41 | 41 |
| 42 void sendTouchCancelPointerEvent(PassRefPtrWillBeRawPtr<EventTarget>, | 42 // Inhibits firing of touch-type PointerEvents until unblocked by unblockTou
chPointers(). Also |
| 43 const PlatformTouchPoint&); | 43 // sends pointercancels for existing touch-type PointerEvents. |
| 44 // See: www.w3.org/TR/pointerevents/#declaring-candidate-regions-for-default
-touch-behaviors |
| 45 void blockTouchPointers(); |
| 46 |
| 47 // Enables firing of touch-type PointerEvents after they were inhibited by b
lockTouchPointers(). |
| 48 void unblockTouchPointers(); |
| 44 | 49 |
| 45 // Sends node transition events mouseout/leave/over/enter to the | 50 // Sends node transition events mouseout/leave/over/enter to the |
| 46 // corresponding targets. This function sends pointerout/leave/over/enter | 51 // corresponding targets. This function sends pointerout/leave/over/enter |
| 47 // only when isFrameBoundaryTransition is true which indicates the | 52 // only when isFrameBoundaryTransition is true which indicates the |
| 48 // transition is over the document boundary and not only the elements border | 53 // transition is over the document boundary and not only the elements border |
| 49 // inside the document. If isFrameBoundaryTransition is false, | 54 // inside the document. If isFrameBoundaryTransition is false, |
| 50 // then the event is a compatibility event like those created by touch | 55 // then the event is a compatibility event like those created by touch |
| 51 // and in that case the corresponding pointer events will be handled by | 56 // and in that case the corresponding pointer events will be handled by |
| 52 // sendTouchPointerEvent for example and there is no need to send pointer | 57 // sendTouchPointerEvent for example and there is no need to send pointer |
| 53 // transition events. Note that normal mouse events (e.g. mousemove/down/up) | 58 // transition events. Note that normal mouse events (e.g. mousemove/down/up) |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 PassRefPtrWillBeRawPtr<EventTarget>, | 132 PassRefPtrWillBeRawPtr<EventTarget>, |
| 128 PassRefPtrWillBeRawPtr<PointerEvent>, | 133 PassRefPtrWillBeRawPtr<PointerEvent>, |
| 129 bool checkForListener = false); | 134 bool checkForListener = false); |
| 130 void releasePointerCapture(int); | 135 void releasePointerCapture(int); |
| 131 | 136 |
| 132 // Prevents firing mousedown, mousemove & mouseup in-between a canceled poin
terdown and next pointerup/pointercancel. | 137 // Prevents firing mousedown, mousemove & mouseup in-between a canceled poin
terdown and next pointerup/pointercancel. |
| 133 // See "PREVENT MOUSE EVENT flag" in the spec: | 138 // See "PREVENT MOUSE EVENT flag" in the spec: |
| 134 // https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-e
vents | 139 // https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-e
vents |
| 135 bool m_preventMouseEventForPointerTypeMouse; | 140 bool m_preventMouseEventForPointerTypeMouse; |
| 136 | 141 |
| 142 // Set upon sending a pointercancel for touch, prevents PE dispatches for to
uches until |
| 143 // all touch-points become inactive. |
| 144 bool m_inCanceledStateForPointerTypeTouch; |
| 145 |
| 137 // Note that this map keeps track of node under pointer with id=1 as well | 146 // Note that this map keeps track of node under pointer with id=1 as well |
| 138 // which might be different than m_nodeUnderMouse in EventHandler. That one | 147 // which might be different than m_nodeUnderMouse in EventHandler. That one |
| 139 // keeps track of any compatibility mouse event positions but this map for | 148 // keeps track of any compatibility mouse event positions but this map for |
| 140 // the pointer with id=1 is only taking care of true mouse related events. | 149 // the pointer with id=1 is only taking care of true mouse related events. |
| 141 WillBeHeapHashMap<int, EventTargetAttributes> m_nodeUnderPointer; | 150 WillBeHeapHashMap<int, EventTargetAttributes> m_nodeUnderPointer; |
| 142 | 151 |
| 143 PointerCapturingMap m_pointerCaptureTarget; | 152 PointerCapturingMap m_pointerCaptureTarget; |
| 144 PointerCapturingMap m_pendingPointerCaptureTarget; | 153 PointerCapturingMap m_pendingPointerCaptureTarget; |
| 145 PointerEventFactory m_pointerEventFactory; | 154 PointerEventFactory m_pointerEventFactory; |
| 146 }; | 155 }; |
| 147 | 156 |
| 148 } // namespace blink | 157 } // namespace blink |
| 149 | 158 |
| 150 #endif // PointerEventManager_h | 159 #endif // PointerEventManager_h |
| OLD | NEW |