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

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: Rebase 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 dd6c4d6cd6b96b0c5a2c9f85cfd09e5d1a8d5069..1ad984b6d2ee03ed4afe9b75552d297d2f030d18 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
@@ -62,8 +62,9 @@ public class VrShell extends GvrLayout implements GLSurfaceView.Renderer, VrShel
}
@Override
- public void onNativeLibraryReady() {
+ public void onNativeLibraryReady(long nativeDelegate) {
Ted C 2016/09/20 20:31:11 try not to pass around raw pointers in java. inst
mNativeVrShell = nativeInit();
+ nativeSetDelegate(mNativeVrShell, nativeDelegate);
}
private static class FrameListener implements OnFrameAvailableListener {
@@ -175,6 +176,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;
}
@@ -203,6 +209,8 @@ public class VrShell extends GvrLayout implements GLSurfaceView.Renderer, VrShel
private native long nativeInit();
Ted C 2016/09/20 20:31:11 fwiw, we usually don't add spaces between our nati
+ private native void nativeSetDelegate(long nativeVrShell, long nativeVrShellDelegate);
+
private native void nativeGvrInit(long nativeVrShell, long nativeGvrApi);
private native void nativeDestroy(long nativeVrShell);
@@ -215,4 +223,6 @@ public class VrShell extends GvrLayout implements GLSurfaceView.Renderer, VrShel
private native void nativeOnPause(long nativeVrShell);
private native void nativeOnResume(long nativeVrShell);
+
+ private native void nativeSetWebVrMode(long nativeVrShell, boolean enabled);
}

Powered by Google App Engine
This is Rietveld 408576698