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