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

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

Issue 2255323004: Create MouseEventManager and EventHandlingUtil (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing Created 4 years, 3 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 MouseEventManager_h
6 #define MouseEventManager_h
7
8 #include "core/CoreExport.h"
9 #include "core/frame/LocalFrame.h"
10 #include "core/input/BoundaryEventDispatcher.h"
11 #include "platform/PlatformMouseEvent.h"
12 #include "public/platform/WebInputEventResult.h"
13 #include "wtf/Allocator.h"
14
15 namespace blink {
16
17 class LocalFrame;
18
19 // This class takes care of dispatching all pointer events and keeps track of
20 // properties of active pointer events.
bokan 2016/09/01 13:50:13 Is "pointer events" here related to actual Pointer
Navid Zolghadr 2016/09/01 17:07:27 Done.
21 class CORE_EXPORT MouseEventManager {
22 WTF_MAKE_NONCOPYABLE(MouseEventManager);
23 DISALLOW_NEW();
24
25 public:
26 explicit MouseEventManager(LocalFrame*);
27 ~MouseEventManager();
28 DECLARE_TRACE();
29
30 WebInputEventResult dispatchMouseEvent(
31 EventTarget*, const AtomicString&, const PlatformMouseEvent&,
32 EventTarget* relatedTarget, int detail = 0,
33 bool checkForListener = false);
34
35 // Resets the internal state of this object.
36 void clear();
37
38 void sendBoundaryEvents(
39 EventTarget* exitedTarget,
40 EventTarget* enteredTarget,
41 const PlatformMouseEvent& mousePlatformEvent);
42
43 private:
44 class MouseEventBoundaryEventDispatcher : public BoundaryEventDispatcher {
45 WTF_MAKE_NONCOPYABLE(MouseEventBoundaryEventDispatcher);
46 DISALLOW_NEW();
47
48 public:
49 DEFINE_INLINE_TRACE()
50 {
51 visitor->trace(m_exitedTarget);
52 BoundaryEventDispatcher::trace(visitor);
53 }
54 MouseEventBoundaryEventDispatcher(MouseEventManager*,
55 const PlatformMouseEvent&, EventTarget* exitedTarget);
56
57 protected:
58 virtual void dispatchOut(EventTarget*, EventTarget* relatedTarget);
59 virtual void dispatchOver(EventTarget*, EventTarget* relatedTarget);
60 virtual void dispatchLeave(EventTarget*, EventTarget* relatedTarget, boo l checkForListener);
61 virtual void dispatchEnter(EventTarget*, EventTarget* relatedTarget, boo l checkForListener);
62 virtual AtomicString getLeaveEvent();
63 virtual AtomicString getEnterEvent();
64
65 private:
66 void dispatch(EventTarget*, EventTarget* relatedTarget,
67 const AtomicString&, const PlatformMouseEvent&,
68 bool checkForListener);
69 MouseEventManager* m_mouseEventManager;
70 PlatformMouseEvent m_platformMouseEvent;
bokan 2016/09/01 13:50:13 Is there a reason we have to copy the PlatformMous
Navid Zolghadr 2016/09/01 14:30:41 I can keep a pointer to that. Do you think that is
bokan 2016/09/01 16:00:54 Yah, lets avoid copying unless we need it.
Navid Zolghadr 2016/09/01 17:07:27 Done.
71 Member<EventTarget> m_exitedTarget;
72 };
73
74 // NOTE: If adding a new field to this class please ensure that it is
75 // cleared in |MouseEventManager::clear()|.
76
77 const Member<LocalFrame> m_frame;
78
79 // The effective position of the mouse pointer.
80 // See https://w3c.github.io/pointerevents/#dfn-tracking-the-effective-posit ion-of-the-legacy-mouse-pointer.
81 Member<Node> m_nodeUnderMouse;
82 };
83
84 } // namespace blink
85
86 #endif // MouseEventManager_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698