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

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: comments 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( 263 if (Env::GetInstance()->mode() == Env::Mode::LOCAL) {
sky 2017/02/15 20:47:17 Is it possible to remove this code and change Env
riajiang 2017/02/16 00:34:08 We are only creating a targeter for the root windo
sky 2017/02/16 01:03:02 The walking only happens in the mus case though, a
riajiang 2017/02/16 19:10:35 Oh I see, thanks for clarifying! You mean also get
264 std::unique_ptr<ui::EventTargeter>(new WindowTargeter())); 264 window()->SetEventTargeter(
265 std::unique_ptr<ui::EventTargeter>(new WindowTargeter()));
266 }
265 dispatcher_.reset(new WindowEventDispatcher(this)); 267 dispatcher_.reset(new WindowEventDispatcher(this));
266 } 268 }
267 } 269 }
268 270
269 void WindowTreeHost::InitCompositor() { 271 void WindowTreeHost::InitCompositor() {
270 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), 272 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()),
271 GetBoundsInPixels().size()); 273 GetBoundsInPixels().size());
272 compositor_->SetRootLayer(window()->layer()); 274 compositor_->SetRootLayer(window()->layer());
273 compositor_->SetDisplayColorSpace( 275 compositor_->SetDisplayColorSpace(
274 GetICCProfileForCurrentDisplay().GetColorSpace()); 276 GetICCProfileForCurrentDisplay().GetColorSpace());
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 client::CursorClient* cursor_client = client::GetCursorClient(window()); 349 client::CursorClient* cursor_client = client::GetCursorClient(window());
348 if (cursor_client) { 350 if (cursor_client) {
349 const display::Display& display = 351 const display::Display& display =
350 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); 352 display::Screen::GetScreen()->GetDisplayNearestWindow(window());
351 cursor_client->SetDisplay(display); 353 cursor_client->SetDisplay(display);
352 } 354 }
353 dispatcher()->OnCursorMovedToRootLocation(root_location); 355 dispatcher()->OnCursorMovedToRootLocation(root_location);
354 } 356 }
355 357
356 } // namespace aura 358 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698