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