OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_tree_host.h" | 5 #include "ui/aura/window_tree_host.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/thread_task_runner_handle.h" | 8 #include "base/thread_task_runner_handle.h" |
9 #include "ui/aura/client/capture_client.h" | 9 #include "ui/aura/client/capture_client.h" |
10 #include "ui/aura/client/cursor_client.h" | 10 #include "ui/aura/client/cursor_client.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 SetCursorNative(cursor); | 145 SetCursorNative(cursor); |
146 } | 146 } |
147 | 147 |
148 void WindowTreeHost::OnCursorVisibilityChanged(bool show) { | 148 void WindowTreeHost::OnCursorVisibilityChanged(bool show) { |
149 // Clear any existing mouse hover effects when the cursor becomes invisible. | 149 // Clear any existing mouse hover effects when the cursor becomes invisible. |
150 // Note we do not need to dispatch a mouse enter when the cursor becomes | 150 // Note we do not need to dispatch a mouse enter when the cursor becomes |
151 // visible because that can only happen in response to a mouse event, which | 151 // visible because that can only happen in response to a mouse event, which |
152 // will trigger its own mouse enter. | 152 // will trigger its own mouse enter. |
153 if (!show) { | 153 if (!show) { |
154 ui::EventDispatchDetails details = dispatcher()->DispatchMouseExitAtPoint( | 154 ui::EventDispatchDetails details = dispatcher()->DispatchMouseExitAtPoint( |
| 155 NULL, |
155 dispatcher()->GetLastMouseLocationInRoot()); | 156 dispatcher()->GetLastMouseLocationInRoot()); |
156 if (details.dispatcher_destroyed) | 157 if (details.dispatcher_destroyed) |
157 return; | 158 return; |
158 } | 159 } |
159 | 160 |
160 OnCursorVisibilityChangedNative(show); | 161 OnCursorVisibilityChangedNative(show); |
161 } | 162 } |
162 | 163 |
163 void WindowTreeHost::MoveCursorTo(const gfx::Point& location_in_dip) { | 164 void WindowTreeHost::MoveCursorTo(const gfx::Point& location_in_dip) { |
164 gfx::Point host_location(location_in_dip); | 165 gfx::Point host_location(location_in_dip); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 client::CursorClient* cursor_client = client::GetCursorClient(window()); | 270 client::CursorClient* cursor_client = client::GetCursorClient(window()); |
270 if (cursor_client) { | 271 if (cursor_client) { |
271 const gfx::Display& display = | 272 const gfx::Display& display = |
272 gfx::Screen::GetScreenFor(window())->GetDisplayNearestWindow(window()); | 273 gfx::Screen::GetScreenFor(window())->GetDisplayNearestWindow(window()); |
273 cursor_client->SetDisplay(display); | 274 cursor_client->SetDisplay(display); |
274 } | 275 } |
275 dispatcher()->OnCursorMovedToRootLocation(root_location); | 276 dispatcher()->OnCursorMovedToRootLocation(root_location); |
276 } | 277 } |
277 | 278 |
278 } // namespace aura | 279 } // namespace aura |
OLD | NEW |