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

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

Issue 2565563003: Revert of Making WTH::InitCompositor() protected instead of public. (Closed)
Patch Set: 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/window_tree_host.h ('k') | no next file » | 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 ui::ViewProp::GetValue(widget, kWindowTreeHostForAcceleratedWidget)); 59 ui::ViewProp::GetValue(widget, kWindowTreeHostForAcceleratedWidget));
60 } 60 }
61 61
62 void WindowTreeHost::InitHost() { 62 void WindowTreeHost::InitHost() {
63 InitCompositor(); 63 InitCompositor();
64 UpdateRootWindowSizeInPixels(GetBoundsInPixels().size()); 64 UpdateRootWindowSizeInPixels(GetBoundsInPixels().size());
65 Env::GetInstance()->NotifyHostInitialized(this); 65 Env::GetInstance()->NotifyHostInitialized(this);
66 window()->Show(); 66 window()->Show();
67 } 67 }
68 68
69 void WindowTreeHost::InitCompositor() {
70 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()),
71 GetBoundsInPixels().size());
72 compositor_->SetRootLayer(window()->layer());
73 compositor_->SetDisplayColorSpace(
74 GetICCProfileForCurrentDisplay().GetColorSpace());
75 }
76
69 void WindowTreeHost::AddObserver(WindowTreeHostObserver* observer) { 77 void WindowTreeHost::AddObserver(WindowTreeHostObserver* observer) {
70 observers_.AddObserver(observer); 78 observers_.AddObserver(observer);
71 } 79 }
72 80
73 void WindowTreeHost::RemoveObserver(WindowTreeHostObserver* observer) { 81 void WindowTreeHost::RemoveObserver(WindowTreeHostObserver* observer) {
74 observers_.RemoveObserver(observer); 82 observers_.RemoveObserver(observer);
75 } 83 }
76 84
77 ui::EventProcessor* WindowTreeHost::event_processor() { 85 ui::EventProcessor* WindowTreeHost::event_processor() {
78 return dispatcher(); 86 return dispatcher();
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 if (!dispatcher()) { 262 if (!dispatcher()) {
255 window()->Init(ui::LAYER_NOT_DRAWN); 263 window()->Init(ui::LAYER_NOT_DRAWN);
256 window()->set_host(this); 264 window()->set_host(this);
257 window()->SetName("RootWindow"); 265 window()->SetName("RootWindow");
258 window()->SetEventTargeter( 266 window()->SetEventTargeter(
259 std::unique_ptr<ui::EventTargeter>(new WindowTargeter())); 267 std::unique_ptr<ui::EventTargeter>(new WindowTargeter()));
260 dispatcher_.reset(new WindowEventDispatcher(this)); 268 dispatcher_.reset(new WindowEventDispatcher(this));
261 } 269 }
262 } 270 }
263 271
264 void WindowTreeHost::InitCompositor() {
265 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()),
266 GetBoundsInPixels().size());
267 compositor_->SetRootLayer(window()->layer());
268 compositor_->SetDisplayColorSpace(
269 GetICCProfileForCurrentDisplay().GetColorSpace());
270 }
271
272 void WindowTreeHost::OnAcceleratedWidgetAvailable() { 272 void WindowTreeHost::OnAcceleratedWidgetAvailable() {
273 compositor_->SetAcceleratedWidget(GetAcceleratedWidget()); 273 compositor_->SetAcceleratedWidget(GetAcceleratedWidget());
274 prop_.reset(new ui::ViewProp(GetAcceleratedWidget(), 274 prop_.reset(new ui::ViewProp(GetAcceleratedWidget(),
275 kWindowTreeHostForAcceleratedWidget, this)); 275 kWindowTreeHostForAcceleratedWidget, this));
276 } 276 }
277 277
278 void WindowTreeHost::OnHostMovedInPixels( 278 void WindowTreeHost::OnHostMovedInPixels(
279 const gfx::Point& new_location_in_pixels) { 279 const gfx::Point& new_location_in_pixels) {
280 TRACE_EVENT1("ui", "WindowTreeHost::OnHostMovedInPixels", "origin", 280 TRACE_EVENT1("ui", "WindowTreeHost::OnHostMovedInPixels", "origin",
281 new_location_in_pixels.ToString()); 281 new_location_in_pixels.ToString());
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 client::CursorClient* cursor_client = client::GetCursorClient(window()); 342 client::CursorClient* cursor_client = client::GetCursorClient(window());
343 if (cursor_client) { 343 if (cursor_client) {
344 const display::Display& display = 344 const display::Display& display =
345 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); 345 display::Screen::GetScreen()->GetDisplayNearestWindow(window());
346 cursor_client->SetDisplay(display); 346 cursor_client->SetDisplay(display);
347 } 347 }
348 dispatcher()->OnCursorMovedToRootLocation(root_location); 348 dispatcher()->OnCursorMovedToRootLocation(root_location);
349 } 349 }
350 350
351 } // namespace aura 351 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/window_tree_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698