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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 EventTarget* related_target, | 50 EventTarget* related_target, |
51 bool check_for_listener = false); | 51 bool check_for_listener = false); |
52 | 52 |
53 WebInputEventResult SetMousePositionAndDispatchMouseEvent( | 53 WebInputEventResult SetMousePositionAndDispatchMouseEvent( |
54 Node* target_node, | 54 Node* target_node, |
55 const String& canvas_region_id, | 55 const String& canvas_region_id, |
56 const AtomicString& event_type, | 56 const AtomicString& event_type, |
57 const WebMouseEvent&); | 57 const WebMouseEvent&); |
58 | 58 |
59 WebInputEventResult DispatchMouseClickIfNeeded( | 59 WebInputEventResult DispatchMouseClickIfNeeded( |
60 const MouseEventWithHitTestResults&); | 60 const MouseEventWithHitTestResults&, |
| 61 Element& mouse_release_target); |
61 | 62 |
62 WebInputEventResult DispatchDragSrcEvent(const AtomicString& event_type, | 63 WebInputEventResult DispatchDragSrcEvent(const AtomicString& event_type, |
63 const WebMouseEvent&); | 64 const WebMouseEvent&); |
64 WebInputEventResult DispatchDragEvent(const AtomicString& event_type, | 65 WebInputEventResult DispatchDragEvent(const AtomicString& event_type, |
65 Node* target, | 66 Node* target, |
66 const WebMouseEvent&, | 67 const WebMouseEvent&, |
67 DataTransfer*); | 68 DataTransfer*); |
68 | 69 |
69 // Resets the internal state of this object. | 70 // Resets the internal state of this object. |
70 void Clear(); | 71 void Clear(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 bool CapturesDragging() const; | 132 bool CapturesDragging() const; |
132 void SetCapturesDragging(bool); | 133 void SetCapturesDragging(bool); |
133 | 134 |
134 void SetMouseDownMayStartAutoscroll() { | 135 void SetMouseDownMayStartAutoscroll() { |
135 mouse_down_may_start_autoscroll_ = true; | 136 mouse_down_may_start_autoscroll_ = true; |
136 } | 137 } |
137 | 138 |
138 Node* MousePressNode(); | 139 Node* MousePressNode(); |
139 void SetMousePressNode(Node*); | 140 void SetMousePressNode(Node*); |
140 | 141 |
141 void SetClickNode(Node*); | 142 void SetClickElement(Element*); |
142 void SetClickCount(int); | 143 void SetClickCount(int); |
143 | 144 |
144 bool MouseDownMayStartDrag(); | 145 bool MouseDownMayStartDrag(); |
145 | 146 |
146 private: | 147 private: |
147 class MouseEventBoundaryEventDispatcher : public BoundaryEventDispatcher { | 148 class MouseEventBoundaryEventDispatcher : public BoundaryEventDispatcher { |
148 WTF_MAKE_NONCOPYABLE(MouseEventBoundaryEventDispatcher); | 149 WTF_MAKE_NONCOPYABLE(MouseEventBoundaryEventDispatcher); |
149 | 150 |
150 public: | 151 public: |
151 MouseEventBoundaryEventDispatcher(MouseEventManager*, | 152 MouseEventBoundaryEventDispatcher(MouseEventManager*, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 unsigned mouse_pressed_ : 1; | 218 unsigned mouse_pressed_ : 1; |
218 | 219 |
219 unsigned mouse_down_may_start_autoscroll_ : 1; | 220 unsigned mouse_down_may_start_autoscroll_ : 1; |
220 unsigned svg_pan_ : 1; | 221 unsigned svg_pan_ : 1; |
221 unsigned captures_dragging_ : 1; | 222 unsigned captures_dragging_ : 1; |
222 unsigned mouse_down_may_start_drag_ : 1; | 223 unsigned mouse_down_may_start_drag_ : 1; |
223 | 224 |
224 Member<Node> mouse_press_node_; | 225 Member<Node> mouse_press_node_; |
225 | 226 |
226 int click_count_; | 227 int click_count_; |
227 Member<Node> click_node_; | 228 Member<Element> click_element_; |
228 | 229 |
229 IntPoint mouse_down_pos_; // In our view's coords. | 230 IntPoint mouse_down_pos_; // In our view's coords. |
230 TimeTicks mouse_down_timestamp_; | 231 TimeTicks mouse_down_timestamp_; |
231 WebMouseEvent mouse_down_; | 232 WebMouseEvent mouse_down_; |
232 | 233 |
233 LayoutPoint drag_start_pos_; | 234 LayoutPoint drag_start_pos_; |
234 | 235 |
235 TaskRunnerTimer<MouseEventManager> fake_mouse_move_event_timer_; | 236 TaskRunnerTimer<MouseEventManager> fake_mouse_move_event_timer_; |
236 }; | 237 }; |
237 | 238 |
238 } // namespace blink | 239 } // namespace blink |
239 | 240 |
240 #endif // MouseEventManager_h | 241 #endif // MouseEventManager_h |
OLD | NEW |