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

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

Issue 1670073004: Send node transition events for touch events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Applying comments Created 4 years, 10 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef PointerEventManager_h
6 #define PointerEventManager_h
7
8 #include "core/CoreExport.h"
9 #include "core/events/PointerEvent.h"
10 #include "core/events/PointerEventFactory.h"
11 #include "public/platform/WebInputEventResult.h"
12 #include "public/platform/WebPointerProperties.h"
13 #include "wtf/Allocator.h"
14 #include "wtf/HashMap.h"
15
16 namespace blink {
17
18
19 // This class takes care of dispatching all pointer events and keeps track of
20 // properties of active pointer events.
21 class CORE_EXPORT PointerEventManager {
22 DISALLOW_NEW();
23 public:
24 PointerEventManager();
25 ~PointerEventManager();
26 DECLARE_TRACE();
27
28 WebInputEventResult sendMousePointerEvent(
29 PassRefPtrWillBeRawPtr<Node>, const AtomicString& type,
30 int clickCount, const PlatformMouseEvent&,
31 PassRefPtrWillBeRawPtr<Node> relatedTarget,
32 PassRefPtrWillBeRawPtr<AbstractView>);
33
34 // Returns whether the event is consumed or not
35 WebInputEventResult sendTouchPointerEvent(
36 PassRefPtrWillBeRawPtr<EventTarget>,
37 const PlatformTouchPoint&, PlatformEvent::Modifiers,
38 const double width, const double height,
39 const double clientX, const double clientY);
40
41 void sendTouchCancelPointerEvent(PassRefPtrWillBeRawPtr<EventTarget>,
42 const PlatformTouchPoint&);
43
44 // Sends node transition events (pointer|mouse)(out|leave|over|enter) to the corresponding targets
45 void sendNodeTransitionEvents(PassRefPtrWillBeRawPtr<Node> exitedNode,
46 PassRefPtrWillBeRawPtr<Node> enteredNode,
47 const PlatformMouseEvent&,
48 PassRefPtrWillBeRawPtr<AbstractView>);
49
50 // Clear all the existing ids.
51 void clear();
52
53 // May clear PREVENT MOUSE EVENT flag as per pointer event spec:
54 // https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-eve nts
55 void conditionallyEnableMouseEventForPointerTypeMouse(unsigned);
56
57
58 private:
59 PassRefPtrWillBeRawPtr<Node> getEffectiveTargetForPointerEvent(
60 PassRefPtrWillBeRawPtr<Node>,
61 PassRefPtrWillBeRawPtr<PointerEvent>);
62 void sendNodeTransitionEvents(
63 PassRefPtrWillBeRawPtr<EventTarget> exitedTarget,
64 PassRefPtrWillBeRawPtr<EventTarget> enteredTarget,
65 PassRefPtrWillBeRawPtr<PointerEvent>,
66 const PlatformMouseEvent& = PlatformMouseEvent(),
67 bool sendMouseEvent = false);
68 void setNodeUnderPointer(PassRefPtrWillBeRawPtr<PointerEvent>,
69 PassRefPtrWillBeRawPtr<EventTarget>);
70
71 // Prevents firing mousedown, mousemove & mouseup in-between a canceled poin terdown and next pointerup/pointercancel.
72 // See "PREVENT MOUSE EVENT flag" in the spec:
73 // https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-e vents
74 bool m_preventMouseEventForPointerTypeMouse;
75
76 // Note that this map keeps track of node under pointer with id=1 as well
77 // which might be different than m_nodeUnderMouse in EventHandler. That one
78 // keeps track of any compatibility mouse event positions but this map for
79 // the pointer with id=1 is only taking care of true mouse related events.
80 WillBeHeapHashMap<int, RefPtrWillBeMember<EventTarget>> m_nodeUnderPointer;
81
82 PointerEventFactory m_pointerEventFactory;
83 };
84
85 } // namespace blink
86
87 #endif // PointerEventManager_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698