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

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

Issue 2681613002: Avoid two targeting phases in aura client-lib and EventProcessor. (Closed)
Patch Set: test Created 3 years, 10 months 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
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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 Env::GetInstance()->context_factory_private(); 253 Env::GetInstance()->context_factory_private();
254 compositor_.reset(new ui::Compositor( 254 compositor_.reset(new ui::Compositor(
255 frame_sink_id.is_valid() ? frame_sink_id 255 frame_sink_id.is_valid() ? frame_sink_id
256 : context_factory_private->AllocateFrameSinkId(), 256 : context_factory_private->AllocateFrameSinkId(),
257 context_factory, context_factory_private, 257 context_factory, context_factory_private,
258 base::ThreadTaskRunnerHandle::Get())); 258 base::ThreadTaskRunnerHandle::Get()));
259 if (!dispatcher()) { 259 if (!dispatcher()) {
260 window()->Init(ui::LAYER_NOT_DRAWN); 260 window()->Init(ui::LAYER_NOT_DRAWN);
261 window()->set_host(this); 261 window()->set_host(this);
262 window()->SetName("RootWindow"); 262 window()->SetName("RootWindow");
263 window()->SetEventTargeter(
264 std::unique_ptr<ui::EventTargeter>(new WindowTargeter()));
265 dispatcher_.reset(new WindowEventDispatcher(this)); 263 dispatcher_.reset(new WindowEventDispatcher(this));
266 } 264 }
267 } 265 }
268 266
269 void WindowTreeHost::InitCompositor() { 267 void WindowTreeHost::InitCompositor() {
270 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), 268 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()),
271 GetBoundsInPixels().size()); 269 GetBoundsInPixels().size());
272 compositor_->SetRootLayer(window()->layer()); 270 compositor_->SetRootLayer(window()->layer());
273 compositor_->SetDisplayColorSpace( 271 compositor_->SetDisplayColorSpace(
274 GetICCProfileForCurrentDisplay().GetColorSpace()); 272 GetICCProfileForCurrentDisplay().GetColorSpace());
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 client::CursorClient* cursor_client = client::GetCursorClient(window()); 345 client::CursorClient* cursor_client = client::GetCursorClient(window());
348 if (cursor_client) { 346 if (cursor_client) {
349 const display::Display& display = 347 const display::Display& display =
350 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); 348 display::Screen::GetScreen()->GetDisplayNearestWindow(window());
351 cursor_client->SetDisplay(display); 349 cursor_client->SetDisplay(display);
352 } 350 }
353 dispatcher()->OnCursorMovedToRootLocation(root_location); 351 dispatcher()->OnCursorMovedToRootLocation(root_location);
354 } 352 }
355 353
356 } // namespace aura 354 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698