Index: chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java |
index 6ea8491b9e3b41178fd4b9e600c6f154c81474e1..cb32865e41856013d1e19c579595aa7e4c0ed3aa 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java |
@@ -764,14 +764,14 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener, |
private static boolean isVrCoreCompatible( |
VrCoreVersionChecker versionChecker, Tab tabToShowInfobarIn) { |
- int vrCoreCompatibility = versionChecker.getVrCoreCompatibility(); |
+ int vrCoreCompatibility = versionChecker.getVrCoreInfo().compatibility; |
- if (vrCoreCompatibility == VrCoreVersionChecker.VR_NOT_AVAILABLE |
- || vrCoreCompatibility == VrCoreVersionChecker.VR_OUT_OF_DATE) { |
+ if (vrCoreCompatibility == VrCoreCompatibility.VR_NOT_AVAILABLE |
+ || vrCoreCompatibility == VrCoreCompatibility.VR_OUT_OF_DATE) { |
promptToUpdateVrServices(vrCoreCompatibility, tabToShowInfobarIn); |
} |
- return vrCoreCompatibility == VrCoreVersionChecker.VR_READY; |
+ return vrCoreCompatibility == VrCoreCompatibility.VR_READY; |
} |
private static void promptToUpdateVrServices(int vrCoreCompatibility, Tab tab) { |
@@ -781,11 +781,11 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener, |
final Activity activity = tab.getActivity(); |
String infobarText; |
String buttonText; |
- if (vrCoreCompatibility == VrCoreVersionChecker.VR_NOT_AVAILABLE) { |
+ if (vrCoreCompatibility == VrCoreCompatibility.VR_NOT_AVAILABLE) { |
// Supported, but not installed. Ask user to install instead of upgrade. |
infobarText = activity.getString(R.string.vr_services_check_infobar_install_text); |
buttonText = activity.getString(R.string.vr_services_check_infobar_install_button); |
- } else if (vrCoreCompatibility == VrCoreVersionChecker.VR_OUT_OF_DATE) { |
+ } else if (vrCoreCompatibility == VrCoreCompatibility.VR_OUT_OF_DATE) { |
infobarText = activity.getString(R.string.vr_services_check_infobar_update_text); |
buttonText = activity.getString(R.string.vr_services_check_infobar_update_button); |
} else { |
@@ -902,6 +902,19 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener, |
return mNativeVrShellDelegate; |
} |
+ @CalledByNative |
+ private long getVrCoreInfo() { |
+ assert mVrCoreVersionChecker != null; |
+ VrCoreInfo vrCoreInfo = mVrCoreVersionChecker.getVrCoreInfo(); |
+ long nativeVrCoreInfo = (vrCoreInfo.gvrVersion != null) |
+ ? nativeMakeNativeVrCoreInfo(mNativeVrShellDelegate, |
+ vrCoreInfo.gvrVersion.majorVersion, vrCoreInfo.gvrVersion.minorVersion, |
+ vrCoreInfo.gvrVersion.patchVersion, vrCoreInfo.compatibility) |
+ : nativeMakeNativeVrCoreInfo( |
+ mNativeVrShellDelegate, 0, 0, 0, vrCoreInfo.compatibility); |
+ return nativeVrCoreInfo; |
+ } |
+ |
private void destroy() { |
if (sInstance == null) return; |
shutdownVr(true, false); |
@@ -920,4 +933,6 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener, |
private native void nativeOnPause(long nativeVrShellDelegate); |
private native void nativeOnResume(long nativeVrShellDelegate); |
private native void nativeDestroy(long nativeVrShellDelegate); |
+ private native long nativeMakeNativeVrCoreInfo(long nativeVrShellDelegate, int majorVersion, |
+ int minorVersion, int patchVersion, int compatibility); |
} |