| 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 DCHECK(Env::GetInstance()); | 243 DCHECK(Env::GetInstance()); |
| 244 ui::ContextFactory* context_factory = Env::GetInstance()->context_factory(); | 244 ui::ContextFactory* context_factory = Env::GetInstance()->context_factory(); |
| 245 DCHECK(context_factory); | 245 DCHECK(context_factory); |
| 246 compositor_.reset( | 246 compositor_.reset( |
| 247 new ui::Compositor(context_factory, base::ThreadTaskRunnerHandle::Get())); | 247 new ui::Compositor(context_factory, base::ThreadTaskRunnerHandle::Get())); |
| 248 if (!dispatcher()) { | 248 if (!dispatcher()) { |
| 249 window()->Init(ui::LAYER_NOT_DRAWN); | 249 window()->Init(ui::LAYER_NOT_DRAWN); |
| 250 window()->set_host(this); | 250 window()->set_host(this); |
| 251 window()->SetName("RootWindow"); | 251 window()->SetName("RootWindow"); |
| 252 window()->SetEventTargeter( | 252 window()->SetEventTargeter( |
| 253 scoped_ptr<ui::EventTargeter>(new WindowTargeter())); | 253 std::unique_ptr<ui::EventTargeter>(new WindowTargeter())); |
| 254 dispatcher_.reset(new WindowEventDispatcher(this)); | 254 dispatcher_.reset(new WindowEventDispatcher(this)); |
| 255 } | 255 } |
| 256 } | 256 } |
| 257 | 257 |
| 258 void WindowTreeHost::OnAcceleratedWidgetAvailable() { | 258 void WindowTreeHost::OnAcceleratedWidgetAvailable() { |
| 259 compositor_->SetAcceleratedWidget(GetAcceleratedWidget()); | 259 compositor_->SetAcceleratedWidget(GetAcceleratedWidget()); |
| 260 prop_.reset(new ui::ViewProp(GetAcceleratedWidget(), | 260 prop_.reset(new ui::ViewProp(GetAcceleratedWidget(), |
| 261 kWindowTreeHostForAcceleratedWidget, this)); | 261 kWindowTreeHostForAcceleratedWidget, this)); |
| 262 } | 262 } |
| 263 | 263 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 client::CursorClient* cursor_client = client::GetCursorClient(window()); | 314 client::CursorClient* cursor_client = client::GetCursorClient(window()); |
| 315 if (cursor_client) { | 315 if (cursor_client) { |
| 316 const gfx::Display& display = | 316 const gfx::Display& display = |
| 317 gfx::Screen::GetScreen()->GetDisplayNearestWindow(window()); | 317 gfx::Screen::GetScreen()->GetDisplayNearestWindow(window()); |
| 318 cursor_client->SetDisplay(display); | 318 cursor_client->SetDisplay(display); |
| 319 } | 319 } |
| 320 dispatcher()->OnCursorMovedToRootLocation(root_location); | 320 dispatcher()->OnCursorMovedToRootLocation(root_location); |
| 321 } | 321 } |
| 322 | 322 |
| 323 } // namespace aura | 323 } // namespace aura |
| OLD | NEW |