| OLD | NEW |
| (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/EventHandlingUtil.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. |
| 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 EventHandlingUtil::Boundary
EventDispatcher { |
| 45 WTF_MAKE_NONCOPYABLE(MouseEventBoundaryEventDispatcher); |
| 46 DISALLOW_NEW(); |
| 47 |
| 48 public: |
| 49 DEFINE_INLINE_TRACE() |
| 50 { |
| 51 visitor->trace(m_exitedTarget); |
| 52 EventHandlingUtil::BoundaryEventDispatcher::trace(visitor); |
| 53 } |
| 54 MouseEventBoundaryEventDispatcher(MouseEventManager*, |
| 55 const PlatformMouseEvent&, EventTarget* exitedTarget); |
| 56 void dispatchOut(EventTarget*, EventTarget* relatedTarget); |
| 57 void dispatchOver(EventTarget*, EventTarget* relatedTarget); |
| 58 void dispatchLeave(EventTarget*, EventTarget* relatedTarget, bool checkF
orListener); |
| 59 void dispatchEnter(EventTarget*, EventTarget* relatedTarget, bool checkF
orListener); |
| 60 |
| 61 private: |
| 62 void dispatch(EventTarget*, EventTarget* relatedTarget, |
| 63 const AtomicString&, const PlatformMouseEvent&, |
| 64 bool checkForListener); |
| 65 MouseEventManager* m_mouseEventManager; |
| 66 PlatformMouseEvent m_platformMouseEvent; |
| 67 Member<EventTarget> m_exitedTarget; |
| 68 }; |
| 69 |
| 70 // NOTE: If adding a new field to this class please ensure that it is |
| 71 // cleared in |MouseEventManager::clear()|. |
| 72 |
| 73 const Member<LocalFrame> m_frame; |
| 74 |
| 75 // The effective position of the mouse pointer. |
| 76 // See https://w3c.github.io/pointerevents/#dfn-tracking-the-effective-posit
ion-of-the-legacy-mouse-pointer. |
| 77 Member<Node> m_nodeUnderMouse; |
| 78 }; |
| 79 |
| 80 } // namespace blink |
| 81 |
| 82 #endif // MouseEventManager_h |
| OLD | NEW |