Commit 7feb50fb authored by Michael Thiessen's avatar Michael Thiessen Committed by Commit Bot

VR: Don't unregister Daydream intent when leaving webVR page if browsing is supported.

If we support browsing in VR, when we leave a page that support presentation
on headset insertion, don't unregister the Daydream intent.

Bug: 728638
Change-Id: Ie9087e2a2a35a6e5d5839b6f1ef0672ba3b781aa
Reviewed-on: https://chromium-review.googlesource.com/521942Reviewed-by: default avatarYash Malik <ymalik@chromium.org>
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#476459}
parent e5a4b69c
......@@ -936,7 +936,8 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
// mListeningForWebVrActivate for them.
if (mVrSupportLevel != VR_DAYDREAM) return;
mListeningForWebVrActivate = listening;
if (listening && !mPaused) {
if (mPaused) return;
if (listening) {
registerDaydreamIntent(mVrDaydreamApi, mActivity);
if (mAutopresentWebVr) {
// Dispatch vrdisplayactivate so that the WebVr page can call requestPresent
......@@ -946,7 +947,7 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
// UI which is suboptimal.
nativeDisplayActivate(mNativeVrShellDelegate);
}
} else {
} else if (!canEnterVr(mActivity.getActivityTab())) {
unregisterDaydreamIntent(mVrDaydreamApi);
}
}
......
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