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

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

Issue 2580093003: Ignore VR_EXTRA boolean in incoming Intent (Closed)
Patch Set: Created 4 years 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/ChromeTabbedActivity.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/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 2f03b0997b1028ab67eea5fc6351c62cc5607c65..90a08007e6c8f290cd4d3f774589ce1cf88f1849 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
@@ -61,7 +61,6 @@ public class VrShellDelegate {
// TODO(bshe): These should be replaced by string provided by NDK. Currently, it only available
// in SDK and we don't want add dependency to SDK just to get these strings.
- private static final String DAYDREAM_VR_EXTRA = "android.intent.extra.VR_LAUNCH";
private static final String DAYDREAM_CATEGORY = "com.google.intent.category.DAYDREAM";
private static final String CARDBOARD_CATEGORY = "com.google.intent.category.CARDBOARD";
@@ -174,7 +173,7 @@ public class VrShellDelegate {
public void enterVRFromIntent(Intent intent) {
// Vr Intent is only used on Daydream devices.
if (mVrSupportLevel != VR_DAYDREAM) return;
- assert isVrIntent(intent);
+ assert isDaydreamVrIntent(intent);
if (mListeningForWebVrActivateBeforePause && !mRequestedWebVR) {
nativeDisplayActivate(mNativeVrShellDelegate);
return;
@@ -555,14 +554,9 @@ public class VrShellDelegate {
/**
* Whether or not the intent is a Daydream VR Intent.
*/
- public boolean isVrIntent(Intent intent) {
- if (intent == null) return false;
- if (intent.getBooleanExtra(DAYDREAM_VR_EXTRA, false)) return true;
- if (intent.getCategories() != null) {
- if (intent.getCategories().contains(DAYDREAM_CATEGORY)) return true;
- if (intent.getCategories().contains(CARDBOARD_CATEGORY)) return true;
- }
- return false;
+ public boolean isDaydreamVrIntent(Intent intent) {
+ if (intent == null || intent.getCategories() == null) return false;
+ return intent.getCategories().contains(DAYDREAM_CATEGORY);
}
/**
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698