| Index: chrome/browser/android/vr_shell/vr_shell.cc
|
| diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc
|
| index 2e8fba0709b366f185af5a76031929bcea3cb4e0..f5526eb6ca142ea0025ad48479223710381910fb 100644
|
| --- a/chrome/browser/android/vr_shell/vr_shell.cc
|
| +++ b/chrome/browser/android/vr_shell/vr_shell.cc
|
| @@ -37,8 +37,7 @@
|
| #include "device/vr/android/gvr/gvr_device_provider.h"
|
| #include "jni/VrShellImpl_jni.h"
|
| #include "third_party/WebKit/public/platform/WebInputEvent.h"
|
| -#include "ui/android/view_android.h"
|
| -#include "ui/android/window_android.h"
|
| +#include "ui/android/view_root.h"
|
| #include "ui/base/page_transition_types.h"
|
| #include "ui/display/display.h"
|
| #include "ui/display/screen.h"
|
| @@ -64,20 +63,20 @@ void SetIsInVR(content::WebContents* contents, bool is_in_vr) {
|
|
|
| VrShell::VrShell(JNIEnv* env,
|
| jobject obj,
|
| - ui::WindowAndroid* content_window,
|
| + ui::ViewRoot* content_view_root,
|
| content::WebContents* ui_contents,
|
| - ui::WindowAndroid* ui_window,
|
| + ui::ViewRoot* ui_view_root,
|
| bool for_web_vr,
|
| VrShellDelegate* delegate,
|
| gvr_context* gvr_api,
|
| bool reprojected_rendering)
|
| : WebContentsObserver(ui_contents),
|
| vr_shell_enabled_(base::FeatureList::IsEnabled(features::kVrShell)),
|
| - content_window_(content_window),
|
| + content_view_root_(content_view_root),
|
| content_compositor_(
|
| - base::MakeUnique<VrCompositor>(content_window_, false)),
|
| + base::MakeUnique<VrCompositor>(content_view_root, false)),
|
| ui_contents_(ui_contents),
|
| - ui_compositor_(base::MakeUnique<VrCompositor>(ui_window, true)),
|
| + ui_compositor_(base::MakeUnique<VrCompositor>(ui_view_root, true)),
|
| delegate_provider_(delegate),
|
| main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()),
|
| reprojected_rendering_(reprojected_rendering),
|
| @@ -482,7 +481,8 @@ void VrShell::MainFrameWasResized(bool width_changed) {
|
|
|
| void VrShell::ContentFrameWasResized(bool width_changed) {
|
| display::Display display =
|
| - display::Screen::GetScreen()->GetDisplayNearestWindow(content_window_);
|
| + display::Screen::GetScreen()->GetDisplayNearestWindowAndroid(
|
| + content_view_root_->GetWindowAndroid());
|
| PostToGlThreadWhenReady(
|
| base::Bind(&VrShellGl::ContentBoundsChanged, gl_thread_->GetVrShellGl(),
|
| display.size().width(), display.size().height()));
|
| @@ -643,16 +643,16 @@ device::mojom::VRDisplayInfoPtr VrShell::CreateVRDisplayInfo(
|
| jlong Init(JNIEnv* env,
|
| const JavaParamRef<jobject>& obj,
|
| const JavaParamRef<jobject>& ui_web_contents,
|
| - jlong content_window_android,
|
| - jlong ui_window_android,
|
| + jlong content_view_root,
|
| + jlong ui_view_root,
|
| jboolean for_web_vr,
|
| const base::android::JavaParamRef<jobject>& delegate,
|
| jlong gvr_api,
|
| jboolean reprojected_rendering) {
|
| return reinterpret_cast<intptr_t>(new VrShell(
|
| - env, obj, reinterpret_cast<ui::WindowAndroid*>(content_window_android),
|
| + env, obj, reinterpret_cast<ui::ViewRoot*>(content_view_root),
|
| content::WebContents::FromJavaWebContents(ui_web_contents),
|
| - reinterpret_cast<ui::WindowAndroid*>(ui_window_android), for_web_vr,
|
| + reinterpret_cast<ui::ViewRoot*>(ui_view_root), for_web_vr,
|
| VrShellDelegate::GetNativeVrShellDelegate(env, delegate),
|
| reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering));
|
| }
|
|
|