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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java

Issue 2595263002: Introduce ViewRoot forwarding input/view events to native (Closed)
Patch Set: tests Created 3 years, 12 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: 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..b4819b4580f906e30cb8527c514fe1b4b6b11315 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,6 +111,9 @@ public class VrShellImpl extends GvrLayout implements VrShell {
mUiVrWindowAndroid = new VrWindowAndroid(mActivity, mUiVirtualDisplay);
mUiContents = WebContentsFactory.createWebContents(true, false);
+ mUiViewRoot = ViewRoot.create(mUiVrWindowAndroid);
+ mUiContents.initViewRoot(mUiViewRoot);
+
mUiCVC = new ContentViewCore(mActivity, ChromeVersionInfo.getProductVersion());
ContentView uiContentView = ContentView.createContentView(mActivity, mUiCVC);
mUiCVC.initialize(ViewAndroidDelegate.createBasicDelegate(uiContentView),
@@ -171,7 +175,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 +188,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

Powered by Google App Engine
This is Rietveld 408576698