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 11 matching lines...) Expand all Loading... | |
| 22 DISALLOW_NEW(); | 22 DISALLOW_NEW(); |
| 23 public: | 23 public: |
| 24 PointerEventManager(); | 24 PointerEventManager(); |
| 25 ~PointerEventManager(); | 25 ~PointerEventManager(); |
| 26 DECLARE_TRACE(); | 26 DECLARE_TRACE(); |
| 27 | 27 |
| 28 WebInputEventResult sendMousePointerEvent( | 28 WebInputEventResult sendMousePointerEvent( |
| 29 PassRefPtrWillBeRawPtr<Node>, const AtomicString& type, | 29 PassRefPtrWillBeRawPtr<Node>, const AtomicString& type, |
| 30 int clickCount, const PlatformMouseEvent&, | 30 int clickCount, const PlatformMouseEvent&, |
| 31 PassRefPtrWillBeRawPtr<Node> relatedTarget, | 31 PassRefPtrWillBeRawPtr<Node> relatedTarget, |
| 32 PassRefPtrWillBeRawPtr<AbstractView>); | 32 PassRefPtrWillBeRawPtr<AbstractView>, |
| 33 PassRefPtrWillBeRawPtr<Node> lastNodeUnderMouse); | |
| 33 | 34 |
| 34 // Returns whether the event is consumed or not | 35 // Returns whether the event is consumed or not |
| 35 WebInputEventResult sendTouchPointerEvent( | 36 WebInputEventResult sendTouchPointerEvent( |
| 36 PassRefPtrWillBeRawPtr<EventTarget>, | 37 PassRefPtrWillBeRawPtr<EventTarget>, |
| 37 const PlatformTouchPoint&, PlatformEvent::Modifiers, | 38 const PlatformTouchPoint&, PlatformEvent::Modifiers, |
| 38 const double width, const double height, | 39 const double width, const double height, |
| 39 const double clientX, const double clientY); | 40 const double clientX, const double clientY); |
| 40 | 41 |
| 41 void sendTouchCancelPointerEvent(PassRefPtrWillBeRawPtr<EventTarget>, | 42 void sendTouchCancelPointerEvent(PassRefPtrWillBeRawPtr<EventTarget>, |
| 42 const PlatformTouchPoint&); | 43 const PlatformTouchPoint&); |
| 43 | 44 |
| 44 // Sends node transition events (pointer|mouse)(out|leave|over|enter) to the corresponding targets | 45 // Sends node transition events (pointer|mouse)(out|leave|over|enter) to the corresponding targets |
|
mustaq
2016/03/22 15:28:43
Name and describe the bool parameter in the commen
Navid Zolghadr
2016/03/22 18:00:24
Done.
| |
| 45 void sendNodeTransitionEvents(PassRefPtrWillBeRawPtr<Node> exitedNode, | 46 void sendNodeTransitionEvents(PassRefPtrWillBeRawPtr<Node> exitedNode, |
| 46 PassRefPtrWillBeRawPtr<Node> enteredNode, | 47 PassRefPtrWillBeRawPtr<Node> enteredNode, |
| 47 const PlatformMouseEvent&, | 48 const PlatformMouseEvent&, |
| 48 PassRefPtrWillBeRawPtr<AbstractView>); | 49 PassRefPtrWillBeRawPtr<AbstractView>, bool); |
| 49 | 50 |
| 50 // Clear all the existing ids. | 51 // Clear all the existing ids. |
| 51 void clear(); | 52 void clear(); |
| 52 | 53 |
| 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 void elementRemoved(EventTarget*); | 54 void elementRemoved(EventTarget*); |
| 58 void setPointerCapture(int, EventTarget*); | 55 void setPointerCapture(int, EventTarget*); |
| 59 void releasePointerCapture(int, EventTarget*); | 56 void releasePointerCapture(int, EventTarget*); |
| 60 bool isActive(const int); | 57 bool isActive(const int); |
| 61 | 58 |
| 62 private: | 59 private: |
| 63 typedef WillBeHeapHashMap<int, RefPtrWillBeMember<EventTarget>> PointerCaptu ringMap; | 60 typedef WillBeHeapHashMap<int, RefPtrWillBeMember<EventTarget>> PointerCaptu ringMap; |
| 64 class EventTargetAttributes { | 61 class EventTargetAttributes { |
| 65 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 62 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 66 public: | 63 public: |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 79 , hasRecievedOverEvent(hasRecievedOverEvent) {} | 76 , hasRecievedOverEvent(hasRecievedOverEvent) {} |
| 80 }; | 77 }; |
| 81 | 78 |
| 82 void sendNodeTransitionEvents( | 79 void sendNodeTransitionEvents( |
| 83 PassRefPtrWillBeRawPtr<EventTarget> exitedTarget, | 80 PassRefPtrWillBeRawPtr<EventTarget> exitedTarget, |
| 84 PassRefPtrWillBeRawPtr<EventTarget> enteredTarget, | 81 PassRefPtrWillBeRawPtr<EventTarget> enteredTarget, |
| 85 PassRefPtrWillBeRawPtr<PointerEvent>, | 82 PassRefPtrWillBeRawPtr<PointerEvent>, |
| 86 const PlatformMouseEvent& = PlatformMouseEvent(), | 83 const PlatformMouseEvent& = PlatformMouseEvent(), |
| 87 bool sendMouseEvent = false); | 84 bool sendMouseEvent = false); |
| 88 void setNodeUnderPointer(PassRefPtrWillBeRawPtr<PointerEvent>, | 85 void setNodeUnderPointer(PassRefPtrWillBeRawPtr<PointerEvent>, |
| 89 PassRefPtrWillBeRawPtr<EventTarget>); | 86 PassRefPtrWillBeRawPtr<EventTarget>, bool sendEvent = true); |
| 90 void processPendingPointerCapture( | 87 |
| 88 // Returns whether the pointer capture is changed. In this case this | |
| 89 // function will take care of transition events and setNodeUnderPointer | |
| 90 // should not send transition events. | |
| 91 bool processPendingPointerCapture( | |
| 91 const PassRefPtrWillBeRawPtr<PointerEvent>, | 92 const PassRefPtrWillBeRawPtr<PointerEvent>, |
| 92 const PassRefPtrWillBeRawPtr<EventTarget>, | 93 const PassRefPtrWillBeRawPtr<EventTarget>, |
| 93 const PlatformMouseEvent& = PlatformMouseEvent(), | 94 const PlatformMouseEvent& = PlatformMouseEvent(), |
| 94 bool sendMouseEvent = false); | 95 bool sendMouseEvent = false); |
| 96 | |
| 97 void prepareForFiringPointerEvent( | |
| 98 const PassRefPtrWillBeRawPtr<PointerEvent>, | |
| 99 const PassRefPtrWillBeRawPtr<EventTarget> hitTestTarget, | |
| 100 const PassRefPtrWillBeRawPtr<EventTarget> lastNodeUnderMouse = nullptr, | |
| 101 const PlatformMouseEvent& = PlatformMouseEvent(), | |
| 102 bool sendMouseEvent = false, | |
| 103 bool isFrameBoundaryTransition = true); | |
| 104 | |
| 95 void removeTargetFromPointerCapturingMapping( | 105 void removeTargetFromPointerCapturingMapping( |
| 96 PointerCapturingMap&, const EventTarget*); | 106 PointerCapturingMap&, const EventTarget*); |
| 97 PassRefPtrWillBeRawPtr<EventTarget> getEffectiveTargetForPointerEvent( | 107 PassRefPtrWillBeRawPtr<EventTarget> getEffectiveTargetForPointerEvent( |
| 98 PassRefPtrWillBeRawPtr<EventTarget>, int); | 108 PassRefPtrWillBeRawPtr<EventTarget>, int); |
| 99 EventTarget* getCapturingNode(int); | 109 EventTarget* getCapturingNode(int); |
| 100 void removePointer(const PassRefPtrWillBeRawPtr<PointerEvent>); | 110 void removePointer(const PassRefPtrWillBeRawPtr<PointerEvent>); |
| 101 WebInputEventResult dispatchPointerEvent( | 111 WebInputEventResult dispatchPointerEvent( |
| 102 PassRefPtrWillBeRawPtr<EventTarget>, | 112 PassRefPtrWillBeRawPtr<EventTarget>, |
| 103 PassRefPtrWillBeRawPtr<PointerEvent>, | 113 PassRefPtrWillBeRawPtr<PointerEvent>, |
| 104 bool checkForListener = false); | 114 bool checkForListener = false); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 116 WillBeHeapHashMap<int, EventTargetAttributes> m_nodeUnderPointer; | 126 WillBeHeapHashMap<int, EventTargetAttributes> m_nodeUnderPointer; |
| 117 | 127 |
| 118 PointerCapturingMap m_pointerCaptureTarget; | 128 PointerCapturingMap m_pointerCaptureTarget; |
| 119 PointerCapturingMap m_pendingPointerCaptureTarget; | 129 PointerCapturingMap m_pendingPointerCaptureTarget; |
| 120 PointerEventFactory m_pointerEventFactory; | 130 PointerEventFactory m_pointerEventFactory; |
| 121 }; | 131 }; |
| 122 | 132 |
| 123 } // namespace blink | 133 } // namespace blink |
| 124 | 134 |
| 125 #endif // PointerEventManager_h | 135 #endif // PointerEventManager_h |
| OLD | NEW |