Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: third_party/WebKit/Source/core/input/PointerEventManager.h

Issue 1989623002: Suppressed MEs for gestures from cancelled PEs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a comment. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // Returns true if the primary pointerdown corresponding to the given
70 // |uniqueTouchEventId| was canceled. Also drops stale ids from
71 // |m_touchIdsForCanceledPointerdowns|.
72 bool primaryPointerdownCanceled(uint32_t uniqueTouchEventId);
73
69 private: 74 private:
70 typedef HeapHashMap<int, Member<EventTarget>, WTF::IntHash<int>, 75 typedef HeapHashMap<int, Member<EventTarget>, WTF::IntHash<int>,
71 WTF::UnsignedWithZeroKeyHashTraits<int>> PointerCapturingMap; 76 WTF::UnsignedWithZeroKeyHashTraits<int>> PointerCapturingMap;
72 class EventTargetAttributes { 77 class EventTargetAttributes {
73 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); 78 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
74 public: 79 public:
75 DEFINE_INLINE_TRACE() 80 DEFINE_INLINE_TRACE()
76 { 81 {
77 visitor->trace(target); 82 visitor->trace(target);
78 } 83 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 160
156 // Prevents firing mousedown, mousemove & mouseup in-between a canceled poin terdown and next pointerup/pointercancel. 161 // Prevents firing mousedown, mousemove & mouseup in-between a canceled poin terdown and next pointerup/pointercancel.
157 // See "PREVENT MOUSE EVENT flag" in the spec: 162 // See "PREVENT MOUSE EVENT flag" in the spec:
158 // https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-e vents 163 // https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-e vents
159 bool m_preventMouseEventForPointerType[static_cast<size_t>(WebPointerPropert ies::PointerType::LastEntry) + 1]; 164 bool m_preventMouseEventForPointerType[static_cast<size_t>(WebPointerPropert ies::PointerType::LastEntry) + 1];
160 165
161 // Set upon sending a pointercancel for touch, prevents PE dispatches for to uches until 166 // Set upon sending a pointercancel for touch, prevents PE dispatches for to uches until
162 // all touch-points become inactive. 167 // all touch-points become inactive.
163 bool m_inCanceledStateForPointerTypeTouch; 168 bool m_inCanceledStateForPointerTypeTouch;
164 169
170 Deque<uint32_t> m_touchIdsForCanceledPointerdowns;
171
165 // Note that this map keeps track of node under pointer with id=1 as well 172 // 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 173 // which might be different than m_nodeUnderMouse in EventHandler. That one
167 // keeps track of any compatibility mouse event positions but this map for 174 // 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. 175 // the pointer with id=1 is only taking care of true mouse related events.
169 using NodeUnderPointerMap = HeapHashMap<int, EventTargetAttributes, 176 using NodeUnderPointerMap = HeapHashMap<int, EventTargetAttributes,
170 WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>>; 177 WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>>;
171 NodeUnderPointerMap m_nodeUnderPointer; 178 NodeUnderPointerMap m_nodeUnderPointer;
172 179
173 PointerCapturingMap m_pointerCaptureTarget; 180 PointerCapturingMap m_pointerCaptureTarget;
174 PointerCapturingMap m_pendingPointerCaptureTarget; 181 PointerCapturingMap m_pendingPointerCaptureTarget;
182
175 PointerEventFactory m_pointerEventFactory; 183 PointerEventFactory m_pointerEventFactory;
176 TouchEventManager m_touchEventManager; 184 TouchEventManager m_touchEventManager;
177
178 }; 185 };
179 186
180 } // namespace blink 187 } // namespace blink
181 188
182 #endif // PointerEventManager_h 189 #endif // PointerEventManager_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698