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

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

Issue 2319863005: Implement new compositor and ContentViewCore reparenting for VR Shell. (Closed)
Patch Set: Created 4 years, 3 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 8aa2998dbf3809c555907c3be86973c650da505d..113164f88a51c1a131a872f8513836d466a065be 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
@@ -15,6 +15,7 @@ import android.view.WindowManager;
import org.chromium.base.Log;
import org.chromium.chrome.browser.ChromeTabbedActivity;
+import org.chromium.chrome.browser.tab.Tab;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
@@ -71,6 +72,12 @@ public class VrShellDelegate {
*/
public boolean enterVRIfNecessary() {
if (!mVrShellEnabled) return false;
+ Tab tab = mActivity.getActivityTab();
+ // TODO(mthiesse): When we have VR UI for opening new tabs, etc., allow VR Shell to be
+ // entered without any current tabs.
+ if (tab == null || tab.getContentViewCore() == null) {
+ return false;
+ }
if (mInVr) return true;
mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
if (!createVrShell()) {
@@ -79,7 +86,7 @@ public class VrShellDelegate {
}
addVrViews();
setupVrModeWindowFlags();
- mVrShellView.onNativeLibraryReady();
+ mVrShellView.onNativeLibraryReady(tab.getContentViewCore());
mVrShellView.setVrModeEnabled(true);
mInVr = true;
return true;

Powered by Google App Engine
This is Rietveld 408576698