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

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

Issue 2776243007: Enable WebVR presentation from Chrome Custom Tab (Closed)
Patch Set: rebase + address nit Created 3 years, 8 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/ChromeTabbedActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
index 8e454fe7e15bf0c3bc5b8a0bd042923c9d40bc3d..2e346fb056c5c124d16bf9f31cfdd06174078299 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -267,13 +267,13 @@ public class ChromeTabbedActivity extends ChromeActivity implements OverviewMode
@Override
public boolean isShowingBrowserControlsEnabled() {
- if (VrShellDelegate.isInVR()) return false;
+ if (VrShellDelegate.isInVr()) return false;
return super.isShowingBrowserControlsEnabled();
}
@Override
public boolean isHidingBrowserControlsEnabled() {
- if (VrShellDelegate.isInVR()) return true;
+ if (VrShellDelegate.isInVr()) return true;
return super.isHidingBrowserControlsEnabled();
}
}
@@ -444,7 +444,7 @@ public class ChromeTabbedActivity extends ChromeActivity implements OverviewMode
@SuppressLint("NewApi")
private boolean shouldDestroyIncognitoProfile() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) return false;
- if (VrShellDelegate.isInVR()) return false; // VR uses an incognito profile for rendering.
+ if (VrShellDelegate.isInVr()) return false; // VR uses an incognito profile for rendering.
Context context = ContextUtils.getApplicationContext();
ActivityManager manager =
@@ -578,10 +578,7 @@ public class ChromeTabbedActivity extends ChromeActivity implements OverviewMode
if (CommandLine.getInstance().hasSwitch(ContentSwitches.ENABLE_TEST_INTENTS)) {
handleDebugIntent(intent);
}
- if (VrShellDelegate.isDaydreamVrIntent(intent)) {
- // TODO(mthiesse): Move this into ChromeActivity. crbug.com/688611
- VrShellDelegate.enterVRFromIntent(intent);
- } else if (ShortcutHelper.isShowToastIntent(intent)) {
+ if (ShortcutHelper.isShowToastIntent(intent)) {
ShortcutHelper.showAddedToHomescreenToastFromIntent(intent);
}
} finally {
@@ -817,12 +814,7 @@ public class ChromeTabbedActivity extends ChromeActivity implements OverviewMode
mIntentWithEffect = false;
if ((mIsOnFirstRun || getSavedInstanceState() == null) && intent != null) {
- if (VrShellDelegate.isDaydreamVrIntent(intent)) {
- // TODO(mthiesse): Improve startup when started from a VR intent.
- // crbug.com/668541
- // TODO(mthiesse): Move this into ChromeActivity. crbug.com/688611
- VrShellDelegate.enterVRIfNecessary();
- } else if (!mIntentHandler.shouldIgnoreIntent(intent)) {
+ if (!mIntentHandler.shouldIgnoreIntent(intent)) {
mIntentWithEffect = mIntentHandler.onNewIntent(intent);
}
@@ -900,10 +892,6 @@ public class ChromeTabbedActivity extends ChromeActivity implements OverviewMode
}
}
return true;
- } else if (requestCode == VrShellDelegate.EXIT_VR_RESULT) {
- // TODO(mthiesse): Move this into ChromeActivity. crbug.com/688611
- VrShellDelegate.onExitVRResult(resultCode);
- return true;
}
return false;
}
@@ -1468,7 +1456,7 @@ public class ChromeTabbedActivity extends ChromeActivity implements OverviewMode
if (!currentModel.isIncognito()) currentModel.openMostRecentlyClosedTab();
RecordUserAction.record("MobileTabClosedUndoShortCut");
} else if (id == R.id.enter_vr_id) {
- VrShellDelegate.enterVRIfNecessary();
+ VrShellDelegate.enterVrIfNecessary();
} else {
return super.onMenuOrKeyboardAction(id, fromMenu);
}
@@ -1941,14 +1929,14 @@ public class ChromeTabbedActivity extends ChromeActivity implements OverviewMode
}
@Override
- public void onEnterVR() {
- super.onEnterVR();
+ public void onEnterVr() {
+ super.onEnterVr();
mControlContainer.setVisibility(View.INVISIBLE);
}
@Override
- public void onExitVR() {
- super.onExitVR();
+ public void onExitVr() {
+ super.onExitVr();
mControlContainer.setVisibility(View.VISIBLE);
// We prevent the incognito profile from being destroyed while in VR, so upon exiting VR we

Powered by Google App Engine
This is Rietveld 408576698