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

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

Issue 2980453002: [vr] Show DOFF when starting Chrome with a VR intent without FRE completion (Closed)
Patch Set: more review comments Created 3 years, 5 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
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 0914c3a1337e8f19d71d1ca6cac30f15f6e4e0c7..4eb49b6d878259994654058def59454bff12f5f2 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
@@ -93,6 +93,7 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
private static final String DAYDREAM_VR_EXTRA = "android.intent.extra.VR_LAUNCH";
private static final String DAYDREAM_HOME_PACKAGE = "com.google.android.vr.home";
+ static final String VR_FRE_INTENT_EXTRA = "org.chromium.chrome.browser.vr_shell.VR_FRE";
// Linter and formatter disagree on how the line below should be formatted.
/* package */
@@ -412,7 +413,7 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
}
@SuppressWarnings("unchecked")
- private static VrClassesWrapper createVrClassesWrapper() {
+ /* package */ static VrClassesWrapper createVrClassesWrapper() {
try {
Class<? extends VrClassesWrapper> vrClassesBuilderClass =
(Class<? extends VrClassesWrapper>) Class.forName(
@@ -841,6 +842,19 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
}
}
+ /**
+ * @return An intent that will launch a VR activity that will prompt the
+ * user to take off their headset and foward the freIntent to the standard
+ * 2D FRE activity.
+ */
+ public static Intent setupVrFreIntent(Context context, Intent freIntent) {
+ Intent intent = new Intent();
+ intent.setClassName(context, VrFirstRunActivity.class.getName());
+ intent.putExtra(VR_FRE_INTENT_EXTRA, new Intent(freIntent));
+ intent.putExtra(DAYDREAM_VR_EXTRA, true);
+ return intent;
+ }
+
/**
* @return Whether or not the given intent is a VR-specific intent.
*/
@@ -848,6 +862,13 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
return IntentUtils.safeGetBooleanExtra(intent, DAYDREAM_VR_EXTRA, false);
}
+ /*
+ * Remove VR-specific extras from the given intent.
+ */
+ public static void removeVrExtras(Intent intent) {
+ intent.removeExtra(DAYDREAM_VR_EXTRA);
+ }
+
/**
* @return Options that a VR-specific Chrome activity should be launched with.
*/

Powered by Google App Engine
This is Rietveld 408576698