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

Unified Diff: ui/aura/window_tree_host_platform.cc

Issue 1455793005: Adding a way to associate Android Activities with PlatformWindowAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@auraclank_upstream_native_widget
Patch Set: Addressing feedback Created 5 years, 1 month 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_platform.cc
diff --git a/ui/aura/window_tree_host_platform.cc b/ui/aura/window_tree_host_platform.cc
index 10c50132dadf2e9a3013e0b29da5dfae52d2eea8..0f834ebfa276992c0d6ba41209cfb84261755f09 100644
--- a/ui/aura/window_tree_host_platform.cc
+++ b/ui/aura/window_tree_host_platform.cc
@@ -11,6 +11,7 @@
#include "ui/gfx/screen.h"
#if defined(OS_ANDROID)
+#include "ui/aura/client/aura_constants.h"
#include "ui/platform_window/android/platform_window_android.h"
#endif
@@ -71,6 +72,15 @@ gfx::AcceleratedWidget WindowTreeHostPlatform::GetAcceleratedWidget() {
}
void WindowTreeHostPlatform::ShowImpl() {
+#if defined(OS_ANDROID)
+ ui::PlatformWindowAndroid* pwa =
+ ui::PlatformWindowAndroid::From(window_.get());
+ if (!pwa->IsAttachedToActivity()) {
+ jobject activity = window()->GetProperty(
+ aura::client::kActivityForRootWindow);
+ pwa->AttachToActivity(activity);
+ }
+#endif
window_->Show();
}

Powered by Google App Engine
This is Rietveld 408576698