| 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/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
| 8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 void WindowTreeHost::OnHostActivated() { | 252 void WindowTreeHost::OnHostActivated() { |
| 253 Env::GetInstance()->NotifyHostActivated(this); | 253 Env::GetInstance()->NotifyHostActivated(this); |
| 254 } | 254 } |
| 255 | 255 |
| 256 void WindowTreeHost::OnHostLostWindowCapture() { | 256 void WindowTreeHost::OnHostLostWindowCapture() { |
| 257 Window* capture_window = client::GetCaptureWindow(window()); | 257 Window* capture_window = client::GetCaptureWindow(window()); |
| 258 if (capture_window && capture_window->GetRootWindow() == window()) | 258 if (capture_window && capture_window->GetRootWindow() == window()) |
| 259 capture_window->ReleaseCapture(); | 259 capture_window->ReleaseCapture(); |
| 260 } | 260 } |
| 261 | 261 |
| 262 void WindowTreeHost::OnHostSetWindowVisibility(bool visible) { |
| 263 FOR_EACH_OBSERVER(WindowTreeHostObserver, observers_, |
| 264 OnHostSetWindowVisibility(this, visible)); |
| 265 } |
| 262 //////////////////////////////////////////////////////////////////////////////// | 266 //////////////////////////////////////////////////////////////////////////////// |
| 263 // WindowTreeHost, private: | 267 // WindowTreeHost, private: |
| 264 | 268 |
| 265 void WindowTreeHost::MoveCursorToInternal(const gfx::Point& root_location, | 269 void WindowTreeHost::MoveCursorToInternal(const gfx::Point& root_location, |
| 266 const gfx::Point& host_location) { | 270 const gfx::Point& host_location) { |
| 267 last_cursor_request_position_in_host_ = host_location; | 271 last_cursor_request_position_in_host_ = host_location; |
| 268 MoveCursorToNative(host_location); | 272 MoveCursorToNative(host_location); |
| 269 client::CursorClient* cursor_client = client::GetCursorClient(window()); | 273 client::CursorClient* cursor_client = client::GetCursorClient(window()); |
| 270 if (cursor_client) { | 274 if (cursor_client) { |
| 271 const gfx::Display& display = | 275 const gfx::Display& display = |
| 272 gfx::Screen::GetScreenFor(window())->GetDisplayNearestWindow(window()); | 276 gfx::Screen::GetScreenFor(window())->GetDisplayNearestWindow(window()); |
| 273 cursor_client->SetDisplay(display); | 277 cursor_client->SetDisplay(display); |
| 274 } | 278 } |
| 275 dispatcher()->OnCursorMovedToRootLocation(root_location); | 279 dispatcher()->OnCursorMovedToRootLocation(root_location); |
| 276 } | 280 } |
| 277 | 281 |
| 278 } // namespace aura | 282 } // namespace aura |
| OLD | NEW |