| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 68 // Returns true if the primary pointerdown corresponding to the given |
| 69 // |uniqueTouchEventId| was canceled. Also drops stale ids from | 69 // |uniqueTouchEventId| was canceled. Also drops stale ids from |
| 70 // |m_touchIdsForCanceledPointerdowns|. | 70 // |m_touchIdsForCanceledPointerdowns|. |
| 71 bool primaryPointerdownCanceled(uint32_t uniqueTouchEventId); | 71 bool primaryPointerdownCanceled(uint32_t uniqueTouchEventId); |
| 72 | 72 |
| 73 // Try to immediately send the got/lostpointercapture without boundary | |
| 74 // events. | |
| 75 // TODO(crbug.com/629935): This function should be private as soon as Pointe
rEventManager | |
| 76 // a GC managed object and postTask can be done internally in this class. | |
| 77 void immediatelyProcessPendingPointerCapture(int pointerId); | |
| 78 | |
| 79 private: | 73 private: |
| 80 typedef HeapHashMap<int, Member<EventTarget>, WTF::IntHash<int>, | 74 typedef HeapHashMap<int, Member<EventTarget>, WTF::IntHash<int>, |
| 81 WTF::UnsignedWithZeroKeyHashTraits<int>> PointerCapturingMap; | 75 WTF::UnsignedWithZeroKeyHashTraits<int>> PointerCapturingMap; |
| 82 class EventTargetAttributes { | 76 class EventTargetAttributes { |
| 83 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 77 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 84 public: | 78 public: |
| 85 DEFINE_INLINE_TRACE() | 79 DEFINE_INLINE_TRACE() |
| 86 { | 80 { |
| 87 visitor->trace(target); | 81 visitor->trace(target); |
| 88 } | 82 } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 void removeTargetFromPointerCapturingMapping( | 143 void removeTargetFromPointerCapturingMapping( |
| 150 PointerCapturingMap&, const EventTarget*); | 144 PointerCapturingMap&, const EventTarget*); |
| 151 EventTarget* getEffectiveTargetForPointerEvent( | 145 EventTarget* getEffectiveTargetForPointerEvent( |
| 152 EventTarget*, int); | 146 EventTarget*, int); |
| 153 EventTarget* getCapturingNode(int); | 147 EventTarget* getCapturingNode(int); |
| 154 void removePointer(PointerEvent*); | 148 void removePointer(PointerEvent*); |
| 155 WebInputEventResult dispatchPointerEvent( | 149 WebInputEventResult dispatchPointerEvent( |
| 156 EventTarget*, | 150 EventTarget*, |
| 157 PointerEvent*, | 151 PointerEvent*, |
| 158 bool checkForListener = false); | 152 bool checkForListener = false); |
| 159 void modifyPendingPointerCapture(int pointerId, EventTarget*); | 153 void releasePointerCapture(int); |
| 160 // Returns true if capture target and pending capture target were different. | |
| 161 bool getPointerCaptureState(int pointerId, | |
| 162 EventTarget** pointerCaptureTarget, | |
| 163 EventTarget** pendingPointerCaptureTarget); | |
| 164 | 154 |
| 165 // NOTE: If adding a new field to this class please ensure that it is | 155 // NOTE: If adding a new field to this class please ensure that it is |
| 166 // cleared in |PointerEventManager::clear()|. | 156 // cleared in |PointerEventManager::clear()|. |
| 167 | 157 |
| 168 const Member<LocalFrame> m_frame; | 158 const Member<LocalFrame> m_frame; |
| 169 | 159 |
| 170 // 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. |
| 171 // See "PREVENT MOUSE EVENT flag" in the spec: | 161 // See "PREVENT MOUSE EVENT flag" in the spec: |
| 172 // https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-e
vents | 162 // https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-e
vents |
| 173 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]; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 189 PointerCapturingMap m_pointerCaptureTarget; | 179 PointerCapturingMap m_pointerCaptureTarget; |
| 190 PointerCapturingMap m_pendingPointerCaptureTarget; | 180 PointerCapturingMap m_pendingPointerCaptureTarget; |
| 191 | 181 |
| 192 PointerEventFactory m_pointerEventFactory; | 182 PointerEventFactory m_pointerEventFactory; |
| 193 TouchEventManager m_touchEventManager; | 183 TouchEventManager m_touchEventManager; |
| 194 }; | 184 }; |
| 195 | 185 |
| 196 } // namespace blink | 186 } // namespace blink |
| 197 | 187 |
| 198 #endif // PointerEventManager_h | 188 #endif // PointerEventManager_h |
| OLD | NEW |