Chromium Code Reviews| 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); |
| } |