Commit 1e7ad3a7 authored by Michael Thiessen's avatar Michael Thiessen Committed by Commit Bot

Support WebVR on standalone VR devices.

Treat standalones as supporting everything, but when we try to enter
browsing mode, exit VR, dropping to the 2D-in-VR path.

Bug: 803202
Change-Id: I3b4e38b530257179f6351e542951ac0eebb956bd
Reviewed-on: https://chromium-review.googlesource.com/1012922Reviewed-by: default avatarYash Malik <ymalik@chromium.org>
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551062}
parent bfabd61d
......@@ -468,7 +468,7 @@ public class VrShellDelegate
// TODO(mthiesse, crbug.com/791090): Re-enable VR mode for devices that boot to VR once we
// support those devices.
VrClassesWrapper wrapper = getVrClassesWrapper();
if (wrapper == null || wrapper.bootsToVr() || !isVrCoreCompatible(tabToShowInfobarIn)) {
if (wrapper == null || !isVrCoreCompatible(tabToShowInfobarIn)) {
return VrSupportLevel.VR_NOT_AVAILABLE;
}
......@@ -705,7 +705,7 @@ public class VrShellDelegate
*/
public static void setVrModeEnabled(Activity activity, boolean enabled) {
VrClassesWrapper wrapper = getVrClassesWrapper();
if (wrapper == null || wrapper.bootsToVr()) return;
if (wrapper == null) return;
ensureLifecycleObserverInitialized();
if (enabled) {
if (sVrModeEnabledActivitys.contains(activity)) return;
......@@ -881,7 +881,7 @@ public class VrShellDelegate
}
public static boolean deviceSupportsVrLaunches() {
return isDaydreamReadyDevice() && !getVrClassesWrapper().bootsToVr();
return isDaydreamReadyDevice();
}
// TODO(mthiesse): Should have package visibility only. We need to unify our vr and vr_shell
......@@ -950,7 +950,7 @@ public class VrShellDelegate
* @return Whether or not VR is supported on this platform.
*/
/* package */ static boolean isVrEnabled() {
return getVrClassesWrapper() != null && !getVrClassesWrapper().bootsToVr();
return getVrClassesWrapper() != null;
}
private static void addBlackOverlayViewForActivity(ChromeActivity activity) {
......@@ -1231,6 +1231,13 @@ public class VrShellDelegate
// UI which is gone.
assert !mPaused;
if (mInVr) return;
if (!mRequestedWebVr && !tentativeWebVrMode && !mAutopresentWebVr
&& getVrClassesWrapper().bootsToVr()) {
// We don't support VR browsing on standalone devices, so if we try to enter browsing
// mode, just drop back to the 2D-in-VR path.
cancelPendingVrEntry();
return;
}
if (mNativeVrShellDelegate == 0) {
cancelPendingVrEntry();
return;
......@@ -1598,6 +1605,12 @@ public class VrShellDelegate
getVrDaydreamApi().launchVrHomescreen();
return;
}
if (getVrClassesWrapper().bootsToVr()) {
shutdownVr(true /* disableVrMode */, true /* stayingInChrome */);
return;
}
if (!isVrBrowsingEnabled()) {
if (isDaydreamCurrentViewerInternal()) {
getVrDaydreamApi().launchVrHomescreen();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment