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

Unified Diff: ui/aura/window_tree_host.cc

Issue 1391893003: NOT FOR REVIEW: Aura on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: ui/aura/window_tree_host.cc
diff --git a/ui/aura/window_tree_host.cc b/ui/aura/window_tree_host.cc
index 5fdadb9ebbb210ea2c3fdf3d5d2d45fc020f4f02..f8fff7c54fbc4cc5f763b970ab9d0ccf0ccf4fbf 100644
--- a/ui/aura/window_tree_host.cc
+++ b/ui/aura/window_tree_host.cc
@@ -49,17 +49,6 @@ WindowTreeHost::~WindowTreeHost() {
}
}
-#if defined(OS_ANDROID)
-// static
-WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) {
- // This is only hit for tests and ash, right now these aren't an issue so
- // adding the CHECK.
- // TODO(sky): decide if we want a factory.
- CHECK(false);
- return nullptr;
-}
-#endif
-
// static
WindowTreeHost* WindowTreeHost::GetForAcceleratedWidget(
gfx::AcceleratedWidget widget) {
@@ -239,30 +228,29 @@ void WindowTreeHost::DestroyDispatcher() {
//window()->RemoveOrDestroyChildren();
}
-void WindowTreeHost::CreateCompositor(
- gfx::AcceleratedWidget accelerated_widget) {
+void WindowTreeHost::CreateCompositor() {
DCHECK(Env::GetInstance());
ui::ContextFactory* context_factory = Env::GetInstance()->context_factory();
DCHECK(context_factory);
compositor_.reset(
- new ui::Compositor(GetAcceleratedWidget(),
- context_factory,
- base::ThreadTaskRunnerHandle::Get()));
- // TODO(beng): I think this setup should probably all move to a "accelerated
- // widget available" function.
+ new ui::Compositor(context_factory, base::ThreadTaskRunnerHandle::Get()));
if (!dispatcher()) {
window()->Init(ui::LAYER_NOT_DRAWN);
window()->set_host(this);
window()->SetName("RootWindow");
window()->SetEventTargeter(
scoped_ptr<ui::EventTargeter>(new WindowTargeter()));
- prop_.reset(new ui::ViewProp(GetAcceleratedWidget(),
- kWindowTreeHostForAcceleratedWidget,
- this));
dispatcher_.reset(new WindowEventDispatcher(this));
}
}
+void WindowTreeHost::OnAcceleratedWidgetAvailable() {
+ compositor_->OnAcceleratedWidgetAvailable(GetAcceleratedWidget());
+ prop_.reset(new ui::ViewProp(GetAcceleratedWidget(),
+ kWindowTreeHostForAcceleratedWidget,
+ this));
+}
+
void WindowTreeHost::OnHostMoved(const gfx::Point& new_location) {
TRACE_EVENT1("ui", "WindowTreeHost::OnHostMoved",
"origin", new_location.ToString());

Powered by Google App Engine
This is Rietveld 408576698