OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "ui/aura/window_event_dispatcher.h" | 5 #include "ui/aura/window_event_dispatcher.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 } | 201 } |
202 | 202 |
203 void WindowEventDispatcher::OnHostLostMouseGrab() { | 203 void WindowEventDispatcher::OnHostLostMouseGrab() { |
204 mouse_pressed_handler_ = NULL; | 204 mouse_pressed_handler_ = NULL; |
205 mouse_moved_handler_ = NULL; | 205 mouse_moved_handler_ = NULL; |
206 } | 206 } |
207 | 207 |
208 void WindowEventDispatcher::OnCursorMovedToRootLocation( | 208 void WindowEventDispatcher::OnCursorMovedToRootLocation( |
209 const gfx::Point& root_location) { | 209 const gfx::Point& root_location) { |
210 SetLastMouseLocation(window(), root_location); | 210 SetLastMouseLocation(window(), root_location); |
211 synthesize_mouse_move_ = false; | 211 |
| 212 // Synthesize a mouse move in case the cursor's location in root coordinates |
| 213 // changed but its position in WindowTreeHost coordinates did not. |
| 214 PostSynthesizeMouseMove(); |
212 } | 215 } |
213 | 216 |
214 void WindowEventDispatcher::OnPostNotifiedWindowDestroying(Window* window) { | 217 void WindowEventDispatcher::OnPostNotifiedWindowDestroying(Window* window) { |
215 OnWindowHidden(window, WINDOW_DESTROYED); | 218 OnWindowHidden(window, WINDOW_DESTROYED); |
216 } | 219 } |
217 | 220 |
218 //////////////////////////////////////////////////////////////////////////////// | 221 //////////////////////////////////////////////////////////////////////////////// |
219 // WindowEventDispatcher, private: | 222 // WindowEventDispatcher, private: |
220 | 223 |
221 Window* WindowEventDispatcher::window() { | 224 Window* WindowEventDispatcher::window() { |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 } | 891 } |
889 | 892 |
890 // This flag is set depending on the gestures recognized in the call above, | 893 // This flag is set depending on the gestures recognized in the call above, |
891 // and needs to propagate with the forwarded event. | 894 // and needs to propagate with the forwarded event. |
892 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); | 895 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); |
893 | 896 |
894 PreDispatchLocatedEvent(target, event); | 897 PreDispatchLocatedEvent(target, event); |
895 } | 898 } |
896 | 899 |
897 } // namespace aura | 900 } // namespace aura |
OLD | NEW |