| Index: chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java
|
| index e479484bc0a87756a3ab30a730e332fc0fce5651..bbbe12df283657103bad34441756915ec9339604 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java
|
| @@ -76,6 +76,7 @@ public class VrShellImpl extends GvrLayout implements VrShell {
|
| private WebContents mUiContents;
|
| private ContentViewCore mUiCVC;
|
| private VrWindowAndroid mUiVrWindowAndroid;
|
| + private ViewRoot mUiViewRoot;
|
|
|
| public VrShellImpl(Activity activity) {
|
| super(activity);
|
| @@ -110,10 +111,12 @@ public class VrShellImpl extends GvrLayout implements VrShell {
|
|
|
| mUiVrWindowAndroid = new VrWindowAndroid(mActivity, mUiVirtualDisplay);
|
| mUiContents = WebContentsFactory.createWebContents(true, false);
|
| + mUiViewRoot = ViewRoot.create(mUiVrWindowAndroid);
|
| +
|
| mUiCVC = new ContentViewCore(mActivity, ChromeVersionInfo.getProductVersion());
|
| ContentView uiContentView = ContentView.createContentView(mActivity, mUiCVC);
|
| mUiCVC.initialize(ViewAndroidDelegate.createBasicDelegate(uiContentView),
|
| - uiContentView, mUiContents, mUiVrWindowAndroid);
|
| + uiContentView, mUiContents, mUiViewRoot);
|
|
|
| mNativeVrShell = nativeInit(mContentCVC.getWebContents(),
|
| mContentVrWindowAndroid.getNativePointer(), mUiContents,
|
| @@ -171,7 +174,7 @@ public class VrShellImpl extends GvrLayout implements VrShell {
|
| Point size = new Point(surfaceWidth, surfaceHeight);
|
| mUiVirtualDisplay.update(size, size, dpr, null, null, null);
|
| mUiCVC.onSizeChanged(surfaceWidth, surfaceHeight, 0, 0);
|
| - getViewRoot(mUiCVC).onPhysicalBackingSizeChanged(surfaceWidth, surfaceHeight);
|
| + mUiViewRoot.onPhysicalBackingSizeChanged(surfaceWidth, surfaceHeight);
|
| nativeUIBoundsChanged(mNativeVrShell, surfaceWidth, surfaceHeight, dpr);
|
| }
|
|
|
| @@ -184,14 +187,10 @@ public class VrShellImpl extends GvrLayout implements VrShell {
|
| Point size = new Point(surfaceWidth, surfaceHeight);
|
| mContentVirtualDisplay.update(size, size, dpr, null, null, null);
|
| mContentCVC.onSizeChanged(surfaceWidth, surfaceHeight, 0, 0);
|
| - getViewRoot(mContentCVC).onPhysicalBackingSizeChanged(surfaceWidth, surfaceHeight);
|
| + mTab.getViewRoot().onPhysicalBackingSizeChanged(surfaceWidth, surfaceHeight);
|
| nativeContentBoundsChanged(mNativeVrShell, surfaceWidth, surfaceHeight, dpr);
|
| }
|
|
|
| - private ViewRoot getViewRoot(ContentViewCore cvc) {
|
| - return cvc.getWindowAndroid().getViewRoot();
|
| - }
|
| -
|
| @Override
|
| public boolean dispatchTouchEvent(MotionEvent event) {
|
| // Normally, touch event is dispatched to presentation view only if the phone is paired with
|
| @@ -237,6 +236,7 @@ public class VrShellImpl extends GvrLayout implements VrShell {
|
| mContentCVC.onSizeChanged(mContentCVC.getContainerView().getWidth(),
|
| mContentCVC.getContainerView().getHeight(), 0, 0);
|
| mUiContents.destroy();
|
| + mUiViewRoot.destroy();
|
| mContentVirtualDisplay.destroy();
|
| mUiVirtualDisplay.destroy();
|
| super.shutdown();
|
|
|