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

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

Issue 2343023002: Switch WebVR to handle GvrApi management through VrShellDelegate (Closed)
Patch Set: Renamed onNativeLibraryReady to initializeNative Created 4 years, 3 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/VrShell.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShell.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShell.java
index 5bd25a049d9809f6421f229ba533fa707e5ae5b5..2f0957e28f79728d8512a8a78235acfa39ad1811 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShell.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShell.java
@@ -103,7 +103,7 @@ public class VrShell extends GvrLayout implements GLSurfaceView.Renderer, VrShel
}
@Override
- public void onNativeLibraryReady(Tab currentTab) {
+ public void initializeNative(Tab currentTab, VrShellDelegate delegate) {
assert currentTab.getContentViewCore() != null;
mTab = currentTab;
mCVC = mTab.getContentViewCore();
@@ -112,6 +112,8 @@ public class VrShell extends GvrLayout implements GLSurfaceView.Renderer, VrShel
mNativeVrShell = nativeInit(mCVC.getWebContents(),
mVRWindowAndroid.getNativePointer());
+ nativeSetDelegate(mNativeVrShell, delegate);
+
reparentContentWindow();
nativeUpdateCompositorLayers(mNativeVrShell);
@@ -266,6 +268,11 @@ public class VrShell extends GvrLayout implements GLSurfaceView.Renderer, VrShel
}
@Override
+ public void setWebVrModeEnabled(boolean enabled) {
+ nativeSetWebVrMode(mNativeVrShell, enabled);
+ }
+
+ @Override
public boolean onTouchEvent(MotionEvent event) {
return true;
}
@@ -294,24 +301,17 @@ public class VrShell extends GvrLayout implements GLSurfaceView.Renderer, VrShel
private native long nativeInit(WebContents contentWebContents,
long nativeContentWindowAndroid);
-
+ private native void nativeSetDelegate(long nativeVrShell, VrShellDelegate delegate);
private native void nativeGvrInit(long nativeVrShell, long nativeGvrApi);
-
private native void nativeDestroy(long nativeVrShell);
-
private native void nativeInitializeGl(
long nativeVrShell, int contentDataHandle);
-
private native void nativeDrawFrame(long nativeVrShell);
-
private native void nativeOnPause(long nativeVrShell);
-
private native void nativeOnResume(long nativeVrShell);
-
private native void nativeContentSurfaceDestroyed(long nativeVrShell);
-
private native void nativeContentSurfaceChanged(
long nativeVrShell, int width, int height, Surface surface);
-
private native void nativeUpdateCompositorLayers(long nativeVrShell);
+ private native void nativeSetWebVrMode(long nativeVrShell, boolean enabled);
}

Powered by Google App Engine
This is Rietveld 408576698