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

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

Issue 1390883003: aura: Unify WindowTreeHost for some platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix ash_unittests, sadrul's comments Created 5 years, 2 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/thread_task_runner_handle.h" 7 #include "base/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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // WindowTreeHost, public: 42 // WindowTreeHost, public:
43 43
44 WindowTreeHost::~WindowTreeHost() { 44 WindowTreeHost::~WindowTreeHost() {
45 DCHECK(!compositor_) << "compositor must be destroyed before root window"; 45 DCHECK(!compositor_) << "compositor must be destroyed before root window";
46 if (owned_input_method_) { 46 if (owned_input_method_) {
47 delete input_method_; 47 delete input_method_;
48 input_method_ = nullptr; 48 input_method_ = nullptr;
49 } 49 }
50 } 50 }
51 51
52 #if defined(OS_ANDROID)
53 // static
54 WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) {
55 // This is only hit for tests and ash, right now these aren't an issue so
56 // adding the CHECK.
57 // TODO(sky): decide if we want a factory.
58 CHECK(false);
59 return nullptr;
60 }
61 #endif
62
63 // static 52 // static
64 WindowTreeHost* WindowTreeHost::GetForAcceleratedWidget( 53 WindowTreeHost* WindowTreeHost::GetForAcceleratedWidget(
65 gfx::AcceleratedWidget widget) { 54 gfx::AcceleratedWidget widget) {
66 return reinterpret_cast<WindowTreeHost*>( 55 return reinterpret_cast<WindowTreeHost*>(
67 ui::ViewProp::GetValue(widget, kWindowTreeHostForAcceleratedWidget)); 56 ui::ViewProp::GetValue(widget, kWindowTreeHostForAcceleratedWidget));
68 } 57 }
69 58
70 void WindowTreeHost::InitHost() { 59 void WindowTreeHost::InitHost() {
71 InitCompositor(); 60 InitCompositor();
72 UpdateRootWindowSize(GetBounds().size()); 61 UpdateRootWindowSize(GetBounds().size());
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 client::CursorClient* cursor_client = client::GetCursorClient(window()); 300 client::CursorClient* cursor_client = client::GetCursorClient(window());
312 if (cursor_client) { 301 if (cursor_client) {
313 const gfx::Display& display = 302 const gfx::Display& display =
314 gfx::Screen::GetScreenFor(window())->GetDisplayNearestWindow(window()); 303 gfx::Screen::GetScreenFor(window())->GetDisplayNearestWindow(window());
315 cursor_client->SetDisplay(display); 304 cursor_client->SetDisplay(display);
316 } 305 }
317 dispatcher()->OnCursorMovedToRootLocation(root_location); 306 dispatcher()->OnCursorMovedToRootLocation(root_location);
318 } 307 }
319 308
320 } // namespace aura 309 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698