| 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 MouseEventManager_h | 5 #ifndef MouseEventManager_h |
| 6 #define MouseEventManager_h | 6 #define MouseEventManager_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/dom/SynchronousMutationObserver.h" | 9 #include "core/dom/SynchronousMutationObserver.h" |
| 10 #include "core/input/BoundaryEventDispatcher.h" | 10 #include "core/input/BoundaryEventDispatcher.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 : public GarbageCollectedFinalized<MouseEventManager>, | 36 : public GarbageCollectedFinalized<MouseEventManager>, |
| 37 public SynchronousMutationObserver { | 37 public SynchronousMutationObserver { |
| 38 WTF_MAKE_NONCOPYABLE(MouseEventManager); | 38 WTF_MAKE_NONCOPYABLE(MouseEventManager); |
| 39 USING_GARBAGE_COLLECTED_MIXIN(MouseEventManager); | 39 USING_GARBAGE_COLLECTED_MIXIN(MouseEventManager); |
| 40 | 40 |
| 41 public: | 41 public: |
| 42 MouseEventManager(LocalFrame&, ScrollManager&); | 42 MouseEventManager(LocalFrame&, ScrollManager&); |
| 43 virtual ~MouseEventManager(); | 43 virtual ~MouseEventManager(); |
| 44 DECLARE_TRACE(); | 44 DECLARE_TRACE(); |
| 45 | 45 |
| 46 enum FakeMouseMoveReason { kDuringScroll, kPerFrame }; |
| 47 |
| 46 WebInputEventResult DispatchMouseEvent(EventTarget*, | 48 WebInputEventResult DispatchMouseEvent(EventTarget*, |
| 47 const AtomicString&, | 49 const AtomicString&, |
| 48 const WebMouseEvent&, | 50 const WebMouseEvent&, |
| 49 const String& canvas_region_id, | 51 const String& canvas_region_id, |
| 50 EventTarget* related_target, | 52 EventTarget* related_target, |
| 51 bool check_for_listener = false); | 53 bool check_for_listener = false); |
| 52 | 54 |
| 53 WebInputEventResult SetMousePositionAndDispatchMouseEvent( | 55 WebInputEventResult SetMousePositionAndDispatchMouseEvent( |
| 54 Node* target_node, | 56 Node* target_node, |
| 55 const String& canvas_region_id, | 57 const String& canvas_region_id, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 80 const String& canvas_region_id, | 82 const String& canvas_region_id, |
| 81 const WebMouseEvent&); | 83 const WebMouseEvent&); |
| 82 | 84 |
| 83 WebInputEventResult HandleMouseFocus( | 85 WebInputEventResult HandleMouseFocus( |
| 84 const HitTestResult&, | 86 const HitTestResult&, |
| 85 InputDeviceCapabilities* source_capabilities); | 87 InputDeviceCapabilities* source_capabilities); |
| 86 | 88 |
| 87 void FakeMouseMoveEventTimerFired(TimerBase*); | 89 void FakeMouseMoveEventTimerFired(TimerBase*); |
| 88 | 90 |
| 89 void CancelFakeMouseMoveEvent(); | 91 void CancelFakeMouseMoveEvent(); |
| 90 void DispatchFakeMouseMoveEventSoon(); | 92 void DispatchFakeMouseMoveEventSoon(MouseEventManager::FakeMouseMoveReason); |
| 91 void DispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&); | 93 void DispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&); |
| 92 | 94 |
| 93 void SetLastKnownMousePosition(const WebMouseEvent&); | 95 void SetLastKnownMousePosition(const WebMouseEvent&); |
| 94 | 96 |
| 95 bool HandleDragDropIfPossible(const GestureEventWithHitTestResults&); | 97 bool HandleDragDropIfPossible(const GestureEventWithHitTestResults&); |
| 96 | 98 |
| 97 WebInputEventResult HandleMouseDraggedEvent( | 99 WebInputEventResult HandleMouseDraggedEvent( |
| 98 const MouseEventWithHitTestResults&); | 100 const MouseEventWithHitTestResults&); |
| 99 WebInputEventResult HandleMousePressEvent( | 101 WebInputEventResult HandleMousePressEvent( |
| 100 const MouseEventWithHitTestResults&); | 102 const MouseEventWithHitTestResults&); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 143 } |
| 142 | 144 |
| 143 Node* MousePressNode(); | 145 Node* MousePressNode(); |
| 144 void SetMousePressNode(Node*); | 146 void SetMousePressNode(Node*); |
| 145 | 147 |
| 146 void SetClickElement(Element*); | 148 void SetClickElement(Element*); |
| 147 void SetClickCount(int); | 149 void SetClickCount(int); |
| 148 | 150 |
| 149 bool MouseDownMayStartDrag(); | 151 bool MouseDownMayStartDrag(); |
| 150 | 152 |
| 153 bool FakeMouseMovePending() const; |
| 154 |
| 151 private: | 155 private: |
| 152 class MouseEventBoundaryEventDispatcher : public BoundaryEventDispatcher { | 156 class MouseEventBoundaryEventDispatcher : public BoundaryEventDispatcher { |
| 153 WTF_MAKE_NONCOPYABLE(MouseEventBoundaryEventDispatcher); | 157 WTF_MAKE_NONCOPYABLE(MouseEventBoundaryEventDispatcher); |
| 154 | 158 |
| 155 public: | 159 public: |
| 156 MouseEventBoundaryEventDispatcher(MouseEventManager*, | 160 MouseEventBoundaryEventDispatcher(MouseEventManager*, |
| 157 const WebMouseEvent*, | 161 const WebMouseEvent*, |
| 158 EventTarget* exited_target, | 162 EventTarget* exited_target, |
| 159 const String& canvas_region_id); | 163 const String& canvas_region_id); |
| 160 | 164 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 WebMouseEvent mouse_down_; | 244 WebMouseEvent mouse_down_; |
| 241 | 245 |
| 242 LayoutPoint drag_start_pos_; | 246 LayoutPoint drag_start_pos_; |
| 243 | 247 |
| 244 TaskRunnerTimer<MouseEventManager> fake_mouse_move_event_timer_; | 248 TaskRunnerTimer<MouseEventManager> fake_mouse_move_event_timer_; |
| 245 }; | 249 }; |
| 246 | 250 |
| 247 } // namespace blink | 251 } // namespace blink |
| 248 | 252 |
| 249 #endif // MouseEventManager_h | 253 #endif // MouseEventManager_h |
| OLD | NEW |