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/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 194 |
195 gfx::Point WindowEventDispatcher::GetLastMouseLocationInRoot() const { | 195 gfx::Point WindowEventDispatcher::GetLastMouseLocationInRoot() const { |
196 gfx::Point location = Env::GetInstance()->last_mouse_location(); | 196 gfx::Point location = Env::GetInstance()->last_mouse_location(); |
197 client::ScreenPositionClient* client = | 197 client::ScreenPositionClient* client = |
198 client::GetScreenPositionClient(window()); | 198 client::GetScreenPositionClient(window()); |
199 if (client) | 199 if (client) |
200 client->ConvertPointFromScreen(window(), &location); | 200 client->ConvertPointFromScreen(window(), &location); |
201 return location; | 201 return location; |
202 } | 202 } |
203 | 203 |
| 204 void WindowEventDispatcher::OnHostLostMouseGrab() { |
| 205 mouse_pressed_handler_ = NULL; |
| 206 mouse_moved_handler_ = NULL; |
| 207 } |
| 208 |
204 void WindowEventDispatcher::OnCursorMovedToRootLocation( | 209 void WindowEventDispatcher::OnCursorMovedToRootLocation( |
205 const gfx::Point& root_location) { | 210 const gfx::Point& root_location) { |
206 SetLastMouseLocation(window(), root_location); | 211 SetLastMouseLocation(window(), root_location); |
207 synthesize_mouse_move_ = false; | 212 synthesize_mouse_move_ = false; |
208 } | 213 } |
209 | 214 |
210 void WindowEventDispatcher::OnPostNotifiedWindowDestroying(Window* window) { | 215 void WindowEventDispatcher::OnPostNotifiedWindowDestroying(Window* window) { |
211 OnWindowHidden(window, WINDOW_DESTROYED); | 216 OnWindowHidden(window, WINDOW_DESTROYED); |
212 } | 217 } |
213 | 218 |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 break; | 863 break; |
859 | 864 |
860 default: | 865 default: |
861 NOTREACHED(); | 866 NOTREACHED(); |
862 break; | 867 break; |
863 } | 868 } |
864 PreDispatchLocatedEvent(target, event); | 869 PreDispatchLocatedEvent(target, event); |
865 } | 870 } |
866 | 871 |
867 } // namespace aura | 872 } // namespace aura |
OLD | NEW |