Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(321)

Side by Side Diff: ui/aura/window_tree_host.cc

Issue 2563783002: ui + mus: Split ContextFactory into ContextFactory(Client) and ContextFactoryPrivate (Closed)
Patch Set: Restore mash Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/aura/test/aura_test_helper.cc ('k') | ui/compositor/compositor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/aura/test/aura_test_helper.cc ('k') | ui/compositor/compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698