| 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 2a7d0541a744fa9e5747798d2f57699cc918aac6..59398808386fe2c05c6a52f4ca391545571978a4 100644
|
| --- a/ui/aura/window_tree_host_platform.cc
|
| +++ b/ui/aura/window_tree_host_platform.cc
|
| @@ -11,6 +11,8 @@
|
| #include "ui/gfx/screen.h"
|
|
|
| #if defined(OS_ANDROID)
|
| +#include "base/android/jni_android.h"
|
| +#include "ui/aura/client/aura_constants.h"
|
| #include "ui/platform_window/android/platform_window_android.h"
|
| #endif
|
|
|
| @@ -72,6 +74,18 @@ gfx::AcceleratedWidget WindowTreeHostPlatform::GetAcceleratedWidget() {
|
| }
|
|
|
| void WindowTreeHostPlatform::ShowImpl() {
|
| +#if defined(OS_ANDROID)
|
| + JNIEnv* env = base::android::AttachCurrentThread();
|
| + ui::PlatformWindowAndroid* pwa =
|
| + ui::PlatformWindowAndroid::From(window_.get());
|
| + if (!pwa->IsAttachedToActivity()) {
|
| + base::android::ScopedJavaLocalRef<jobject> activity =
|
| + window()->GetProperty(aura::client::kActivityForRootWindow)->get(env);
|
| + if (activity.is_null())
|
| + return;
|
| + pwa->AttachToActivity(env, activity);
|
| + }
|
| +#endif
|
| window_->Show();
|
| }
|
|
|
|
|