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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 void clear(); | 58 void clear(); |
59 | 59 |
60 void elementRemoved(EventTarget*); | 60 void elementRemoved(EventTarget*); |
61 void setPointerCapture(int, EventTarget*); | 61 void setPointerCapture(int, EventTarget*); |
62 void releasePointerCapture(int, EventTarget*); | 62 void releasePointerCapture(int, EventTarget*); |
63 bool isActive(const int) const; | 63 bool isActive(const int) const; |
64 | 64 |
65 // Returns whether there is any touch on the screen. | 65 // Returns whether there is any touch on the screen. |
66 bool isAnyTouchActive() const; | 66 bool isAnyTouchActive() const; |
67 | 67 |
| 68 // Returns true if the primary pointerdown corresponding to the given |
| 69 // |uniqueTouchEventId| was canceled. Also drops stale ids from |
| 70 // |m_touchIdsForCanceledPointerdowns|. |
| 71 bool primaryPointerdownCanceled(uint32_t uniqueTouchEventId); |
| 72 |
68 private: | 73 private: |
69 typedef HeapHashMap<int, Member<EventTarget>, WTF::IntHash<int>, | 74 typedef HeapHashMap<int, Member<EventTarget>, WTF::IntHash<int>, |
70 WTF::UnsignedWithZeroKeyHashTraits<int>> PointerCapturingMap; | 75 WTF::UnsignedWithZeroKeyHashTraits<int>> PointerCapturingMap; |
71 class EventTargetAttributes { | 76 class EventTargetAttributes { |
72 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 77 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
73 public: | 78 public: |
74 DEFINE_INLINE_TRACE() | 79 DEFINE_INLINE_TRACE() |
75 { | 80 { |
76 visitor->trace(target); | 81 visitor->trace(target); |
77 } | 82 } |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 159 |
155 // Prevents firing mousedown, mousemove & mouseup in-between a canceled poin
terdown and next pointerup/pointercancel. | 160 // Prevents firing mousedown, mousemove & mouseup in-between a canceled poin
terdown and next pointerup/pointercancel. |
156 // See "PREVENT MOUSE EVENT flag" in the spec: | 161 // See "PREVENT MOUSE EVENT flag" in the spec: |
157 // https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-e
vents | 162 // https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-e
vents |
158 bool m_preventMouseEventForPointerType[static_cast<size_t>(WebPointerPropert
ies::PointerType::LastEntry) + 1]; | 163 bool m_preventMouseEventForPointerType[static_cast<size_t>(WebPointerPropert
ies::PointerType::LastEntry) + 1]; |
159 | 164 |
160 // Set upon sending a pointercancel for touch, prevents PE dispatches for to
uches until | 165 // Set upon sending a pointercancel for touch, prevents PE dispatches for to
uches until |
161 // all touch-points become inactive. | 166 // all touch-points become inactive. |
162 bool m_inCanceledStateForPointerTypeTouch; | 167 bool m_inCanceledStateForPointerTypeTouch; |
163 | 168 |
| 169 Deque<uint32_t> m_touchIdsForCanceledPointerdowns; |
| 170 |
164 // Note that this map keeps track of node under pointer with id=1 as well | 171 // Note that this map keeps track of node under pointer with id=1 as well |
165 // which might be different than m_nodeUnderMouse in EventHandler. That one | 172 // which might be different than m_nodeUnderMouse in EventHandler. That one |
166 // keeps track of any compatibility mouse event positions but this map for | 173 // keeps track of any compatibility mouse event positions but this map for |
167 // the pointer with id=1 is only taking care of true mouse related events. | 174 // the pointer with id=1 is only taking care of true mouse related events. |
168 using NodeUnderPointerMap = HeapHashMap<int, EventTargetAttributes, | 175 using NodeUnderPointerMap = HeapHashMap<int, EventTargetAttributes, |
169 WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>>; | 176 WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>>; |
170 NodeUnderPointerMap m_nodeUnderPointer; | 177 NodeUnderPointerMap m_nodeUnderPointer; |
171 | 178 |
172 PointerCapturingMap m_pointerCaptureTarget; | 179 PointerCapturingMap m_pointerCaptureTarget; |
173 PointerCapturingMap m_pendingPointerCaptureTarget; | 180 PointerCapturingMap m_pendingPointerCaptureTarget; |
| 181 |
174 PointerEventFactory m_pointerEventFactory; | 182 PointerEventFactory m_pointerEventFactory; |
175 TouchEventManager m_touchEventManager; | 183 TouchEventManager m_touchEventManager; |
176 | |
177 }; | 184 }; |
178 | 185 |
179 } // namespace blink | 186 } // namespace blink |
180 | 187 |
181 #endif // PointerEventManager_h | 188 #endif // PointerEventManager_h |
OLD | NEW |