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 | |
209 void WindowEventDispatcher::OnCursorMovedToRootLocation( | 204 void WindowEventDispatcher::OnCursorMovedToRootLocation( |
210 const gfx::Point& root_location) { | 205 const gfx::Point& root_location) { |
211 SetLastMouseLocation(window(), root_location); | 206 SetLastMouseLocation(window(), root_location); |
212 synthesize_mouse_move_ = false; | 207 synthesize_mouse_move_ = false; |
213 } | 208 } |
214 | 209 |
215 void WindowEventDispatcher::OnPostNotifiedWindowDestroying(Window* window) { | 210 void WindowEventDispatcher::OnPostNotifiedWindowDestroying(Window* window) { |
216 OnWindowHidden(window, WINDOW_DESTROYED); | 211 OnWindowHidden(window, WINDOW_DESTROYED); |
217 } | 212 } |
218 | 213 |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 break; | 858 break; |
864 | 859 |
865 default: | 860 default: |
866 NOTREACHED(); | 861 NOTREACHED(); |
867 break; | 862 break; |
868 } | 863 } |
869 PreDispatchLocatedEvent(target, event); | 864 PreDispatchLocatedEvent(target, event); |
870 } | 865 } |
871 | 866 |
872 } // namespace aura | 867 } // namespace aura |
OLD | NEW |