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

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

Issue 2903573004: Fix exiting WebVR present. (Closed)
Patch Set: Rebased on ToT Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4dfe4c64ad5f8cf6e828be0bf4870cc44c670092..82f96c32d103c98920250cb675de89dacdd470e0 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
@@ -723,16 +723,18 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
@CalledByNative
private boolean exitWebVRPresent() {
if (!mInVr) return false;
- if (!isVrShellEnabled(mVrSupportLevel) || !activitySupportsVrBrowsing(mActivity)) {
- if (mVrDaydreamApi.exitFromVr(EXIT_VR_RESULT, new Intent())) {
+ if (!isVrShellEnabled(mVrSupportLevel) || !mVrDaydreamApi.isDaydreamCurrentViewer()
+ || !activitySupportsVrBrowsing(mActivity)) {
+ if (mVrDaydreamApi.isDaydreamCurrentViewer()
+ && mVrDaydreamApi.exitFromVr(EXIT_VR_RESULT, new Intent())) {
mShowingDaydreamDoff = true;
return false;
}
- mVrShell.setWebVrModeEnabled(false);
shutdownVr(
true /* disableVrMode */, false /* canReenter */, true /* stayingInChrome */);
} else {
mVrBrowserUsed = true;
+ mVrShell.setWebVrModeEnabled(false);
}
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698