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" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 // ~Window, but by that time any calls to virtual methods overriden here (such | 247 // ~Window, but by that time any calls to virtual methods overriden here (such |
248 // as GetRootWindow()) result in Window's implementation. By destroying here | 248 // as GetRootWindow()) result in Window's implementation. By destroying here |
249 // we ensure GetRootWindow() still returns this. | 249 // we ensure GetRootWindow() still returns this. |
250 //window()->RemoveOrDestroyChildren(); | 250 //window()->RemoveOrDestroyChildren(); |
251 } | 251 } |
252 | 252 |
253 void WindowTreeHost::CreateCompositor() { | 253 void WindowTreeHost::CreateCompositor() { |
254 DCHECK(Env::GetInstance()); | 254 DCHECK(Env::GetInstance()); |
255 ui::ContextFactory* context_factory = Env::GetInstance()->context_factory(); | 255 ui::ContextFactory* context_factory = Env::GetInstance()->context_factory(); |
256 DCHECK(context_factory); | 256 DCHECK(context_factory); |
257 compositor_.reset( | 257 ui::ContextFactoryPrivate* context_factory_private = |
258 new ui::Compositor(context_factory, base::ThreadTaskRunnerHandle::Get())); | 258 Env::GetInstance()->context_factory_private(); |
| 259 compositor_.reset(new ui::Compositor(context_factory, context_factory_private, |
| 260 base::ThreadTaskRunnerHandle::Get())); |
259 if (!dispatcher()) { | 261 if (!dispatcher()) { |
260 window()->Init(ui::LAYER_NOT_DRAWN); | 262 window()->Init(ui::LAYER_NOT_DRAWN); |
261 window()->set_host(this); | 263 window()->set_host(this); |
262 window()->SetName("RootWindow"); | 264 window()->SetName("RootWindow"); |
263 window()->SetEventTargeter( | 265 window()->SetEventTargeter( |
264 std::unique_ptr<ui::EventTargeter>(new WindowTargeter())); | 266 std::unique_ptr<ui::EventTargeter>(new WindowTargeter())); |
265 dispatcher_.reset(new WindowEventDispatcher(this)); | 267 dispatcher_.reset(new WindowEventDispatcher(this)); |
266 } | 268 } |
267 } | 269 } |
268 | 270 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 client::CursorClient* cursor_client = client::GetCursorClient(window()); | 341 client::CursorClient* cursor_client = client::GetCursorClient(window()); |
340 if (cursor_client) { | 342 if (cursor_client) { |
341 const display::Display& display = | 343 const display::Display& display = |
342 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); | 344 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); |
343 cursor_client->SetDisplay(display); | 345 cursor_client->SetDisplay(display); |
344 } | 346 } |
345 dispatcher()->OnCursorMovedToRootLocation(root_location); | 347 dispatcher()->OnCursorMovedToRootLocation(root_location); |
346 } | 348 } |
347 | 349 |
348 } // namespace aura | 350 } // namespace aura |
OLD | NEW |