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

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

Issue 2941173002: Prevent "Incompatible App" message when entering VR. (Closed)
Patch Set: Resolve findbugs issue. Created 3 years, 6 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 | « chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java ('k') | 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/VrShellImpl.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java
index a6c2d012f4ba28074bfba281d279e47433fcfe0a..f10b515b47eebd54744b2b5f0af976b2f39a58be 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java
@@ -19,7 +19,6 @@ import android.view.SurfaceView;
import android.view.View;
import android.view.ViewTreeObserver.OnPreDrawListener;
import android.widget.FrameLayout;
-import android.widget.FrameLayout.LayoutParams;
import com.google.vr.ndk.base.AndroidCompat;
import com.google.vr.ndk.base.GvrLayout;
@@ -130,6 +129,11 @@ public class VrShellImpl
mDelegate = delegate;
mTabModelSelector = tabModelSelector;
+ // This overrides the default intent created by GVR to return to Chrome when the DON flow
+ // is triggered by resuming the GvrLayout, which is the usual way Daydream apps enter VR.
+ // See VrShellDelegate#getEnterVrPendingIntent for why we need to do this.
+ setReentryIntent(VrShellDelegate.getEnterVrPendingIntent(activity));
+
mReprojectedRendering = setAsyncReprojectionEnabled(true);
if (mReprojectedRendering) {
// No need render to a Surface if we're reprojected. We'll be rendering with surfaceless
@@ -725,9 +729,9 @@ public class VrShellImpl
public void removeWindowAndroidChangedObserver(WindowAndroidChangedObserver observer) {}
/**
- * Sets the runnable that will be run when VrShellImpl's dispatchTouchEvent
+ * Sets the callback that will be run when VrShellImpl's dispatchTouchEvent
* is run and the parent consumed the event.
- * @param runnable The Runnable that will be run
+ * @param callback The Callback to be run.
*/
@VisibleForTesting
public void setOnDispatchTouchEventForTesting(OnDispatchTouchEventCallback callback) {
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698