Chromium Code Reviews| 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. | |
|
haraken
2016/07/21 15:08:09
Why is it okay to not dispatch boundary events?
Navid Zolghadr
2016/07/21 19:17:22
There was this discussion to change the way we sen
| |
| 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 | |
| 73 private: | 79 private: |
| 74 typedef HeapHashMap<int, Member<EventTarget>, WTF::IntHash<int>, | 80 typedef HeapHashMap<int, Member<EventTarget>, WTF::IntHash<int>, |
| 75 WTF::UnsignedWithZeroKeyHashTraits<int>> PointerCapturingMap; | 81 WTF::UnsignedWithZeroKeyHashTraits<int>> PointerCapturingMap; |
| 76 class EventTargetAttributes { | 82 class EventTargetAttributes { |
| 77 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 83 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 78 public: | 84 public: |
| 79 DEFINE_INLINE_TRACE() | 85 DEFINE_INLINE_TRACE() |
| 80 { | 86 { |
| 81 visitor->trace(target); | 87 visitor->trace(target); |
| 82 } | 88 } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 void removeTargetFromPointerCapturingMapping( | 149 void removeTargetFromPointerCapturingMapping( |
| 144 PointerCapturingMap&, const EventTarget*); | 150 PointerCapturingMap&, const EventTarget*); |
| 145 EventTarget* getEffectiveTargetForPointerEvent( | 151 EventTarget* getEffectiveTargetForPointerEvent( |
| 146 EventTarget*, int); | 152 EventTarget*, int); |
| 147 EventTarget* getCapturingNode(int); | 153 EventTarget* getCapturingNode(int); |
| 148 void removePointer(PointerEvent*); | 154 void removePointer(PointerEvent*); |
| 149 WebInputEventResult dispatchPointerEvent( | 155 WebInputEventResult dispatchPointerEvent( |
| 150 EventTarget*, | 156 EventTarget*, |
| 151 PointerEvent*, | 157 PointerEvent*, |
| 152 bool checkForListener = false); | 158 bool checkForListener = false); |
| 153 void releasePointerCapture(int); | 159 void modifyPendingPointerCapture(int pointerId, EventTarget*); |
| 160 // Returns true if capture target and pending capture target were different. | |
| 161 bool getPointerCaptureState(int pointerId, | |
| 162 EventTarget** pointerCaptureTarget, | |
| 163 EventTarget** pendingPointerCaptureTarget); | |
| 154 | 164 |
| 155 // NOTE: If adding a new field to this class please ensure that it is | 165 // NOTE: If adding a new field to this class please ensure that it is |
| 156 // cleared in |PointerEventManager::clear()|. | 166 // cleared in |PointerEventManager::clear()|. |
| 157 | 167 |
| 158 const Member<LocalFrame> m_frame; | 168 const Member<LocalFrame> m_frame; |
| 159 | 169 |
| 160 // Prevents firing mousedown, mousemove & mouseup in-between a canceled poin terdown and next pointerup/pointercancel. | 170 // Prevents firing mousedown, mousemove & mouseup in-between a canceled poin terdown and next pointerup/pointercancel. |
| 161 // See "PREVENT MOUSE EVENT flag" in the spec: | 171 // See "PREVENT MOUSE EVENT flag" in the spec: |
| 162 // https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-e vents | 172 // https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-e vents |
| 163 bool m_preventMouseEventForPointerType[static_cast<size_t>(WebPointerPropert ies::PointerType::LastEntry) + 1]; | 173 bool m_preventMouseEventForPointerType[static_cast<size_t>(WebPointerPropert ies::PointerType::LastEntry) + 1]; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 179 PointerCapturingMap m_pointerCaptureTarget; | 189 PointerCapturingMap m_pointerCaptureTarget; |
| 180 PointerCapturingMap m_pendingPointerCaptureTarget; | 190 PointerCapturingMap m_pendingPointerCaptureTarget; |
| 181 | 191 |
| 182 PointerEventFactory m_pointerEventFactory; | 192 PointerEventFactory m_pointerEventFactory; |
| 183 TouchEventManager m_touchEventManager; | 193 TouchEventManager m_touchEventManager; |
| 184 }; | 194 }; |
| 185 | 195 |
| 186 } // namespace blink | 196 } // namespace blink |
| 187 | 197 |
| 188 #endif // PointerEventManager_h | 198 #endif // PointerEventManager_h |
| OLD | NEW |