| 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/threading/thread_task_runner_handle.h" | 7 #include "base/threading/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" |
| 11 #include "ui/aura/env.h" | 11 #include "ui/aura/env.h" |
| 12 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
| 13 #include "ui/aura/window_event_dispatcher.h" | 13 #include "ui/aura/window_event_dispatcher.h" |
| 14 #include "ui/aura/window_port.h" |
| 14 #include "ui/aura/window_targeter.h" | 15 #include "ui/aura/window_targeter.h" |
| 15 #include "ui/aura/window_tree_host_observer.h" | 16 #include "ui/aura/window_tree_host_observer.h" |
| 16 #include "ui/base/ime/input_method.h" | 17 #include "ui/base/ime/input_method.h" |
| 17 #include "ui/base/ime/input_method_factory.h" | 18 #include "ui/base/ime/input_method_factory.h" |
| 18 #include "ui/base/view_prop.h" | 19 #include "ui/base/view_prop.h" |
| 19 #include "ui/compositor/dip_util.h" | 20 #include "ui/compositor/dip_util.h" |
| 20 #include "ui/compositor/layer.h" | 21 #include "ui/compositor/layer.h" |
| 21 #include "ui/display/display.h" | 22 #include "ui/display/display.h" |
| 22 #include "ui/display/screen.h" | 23 #include "ui/display/screen.h" |
| 23 #include "ui/gfx/geometry/insets.h" | 24 #include "ui/gfx/geometry/insets.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 212 |
| 212 void WindowTreeHost::Hide() { | 213 void WindowTreeHost::Hide() { |
| 213 HideImpl(); | 214 HideImpl(); |
| 214 if (compositor()) | 215 if (compositor()) |
| 215 compositor()->SetVisible(false); | 216 compositor()->SetVisible(false); |
| 216 } | 217 } |
| 217 | 218 |
| 218 //////////////////////////////////////////////////////////////////////////////// | 219 //////////////////////////////////////////////////////////////////////////////// |
| 219 // WindowTreeHost, protected: | 220 // WindowTreeHost, protected: |
| 220 | 221 |
| 221 WindowTreeHost::WindowTreeHost() | 222 WindowTreeHost::WindowTreeHost() : WindowTreeHost(nullptr) {} |
| 222 : window_(new Window(nullptr)), | 223 |
| 224 WindowTreeHost::WindowTreeHost(std::unique_ptr<WindowPort> window_port) |
| 225 : window_(new Window(nullptr, std::move(window_port))), |
| 223 last_cursor_(ui::kCursorNull), | 226 last_cursor_(ui::kCursorNull), |
| 224 input_method_(nullptr), | 227 input_method_(nullptr), |
| 225 owned_input_method_(false) { | 228 owned_input_method_(false) {} |
| 226 } | |
| 227 | 229 |
| 228 void WindowTreeHost::DestroyCompositor() { | 230 void WindowTreeHost::DestroyCompositor() { |
| 229 compositor_.reset(); | 231 compositor_.reset(); |
| 230 } | 232 } |
| 231 | 233 |
| 232 void WindowTreeHost::DestroyDispatcher() { | 234 void WindowTreeHost::DestroyDispatcher() { |
| 233 delete window_; | 235 delete window_; |
| 234 window_ = nullptr; | 236 window_ = nullptr; |
| 235 dispatcher_.reset(); | 237 dispatcher_.reset(); |
| 236 | 238 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 client::CursorClient* cursor_client = client::GetCursorClient(window()); | 333 client::CursorClient* cursor_client = client::GetCursorClient(window()); |
| 332 if (cursor_client) { | 334 if (cursor_client) { |
| 333 const display::Display& display = | 335 const display::Display& display = |
| 334 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); | 336 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); |
| 335 cursor_client->SetDisplay(display); | 337 cursor_client->SetDisplay(display); |
| 336 } | 338 } |
| 337 dispatcher()->OnCursorMovedToRootLocation(root_location); | 339 dispatcher()->OnCursorMovedToRootLocation(root_location); |
| 338 } | 340 } |
| 339 | 341 |
| 340 } // namespace aura | 342 } // namespace aura |
| OLD | NEW |