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

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

Issue 2562733002: Implement our own GLThread for VR Shell. (Closed)
Patch Set: Address comment 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
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 7b57651dabeaaecd25f81ee26e4bad47b428046e..8d797b136f24e6d4b77d5e62571222fd6e00e3e5 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
@@ -193,8 +193,8 @@ public class VrShellDelegate {
mTab.addObserver(mTabObserver);
addVrViews();
setupVrModeWindowFlags();
- mVrShell.initializeNativeOnUI(mTab, this, mRequestedWebVR);
- mVrShell.setCloseButtonListenerOnUI(new Runnable() {
+ mVrShell.initializeNative(mTab, this, mRequestedWebVR);
+ mVrShell.setCloseButtonListener(new Runnable() {
@Override
public void run() {
exitVRIfNecessary(false);
@@ -202,7 +202,7 @@ public class VrShellDelegate {
});
// onResume needs to be called on GvrLayout after initialization to make sure DON flow work
// properly.
- mVrShell.resumeOnUI();
+ mVrShell.resume();
mTab.updateFullscreenEnabledState();
return true;
}
@@ -241,7 +241,7 @@ public class VrShellDelegate {
mRequestedWebVR = true;
switch (enterVRIfNecessary()) {
case ENTER_VR_NOT_NECESSARY:
- mVrShell.setWebVrModeEnabledOnUI(true);
+ mVrShell.setWebVrModeEnabled(true);
nativeSetPresentResult(mNativeVrShellDelegate, true);
mRequestedWebVR = false;
break;
@@ -282,7 +282,7 @@ public class VrShellDelegate {
@CalledByNative
private boolean exitWebVR() {
if (!mInVr) return false;
- mVrShell.setWebVrModeEnabledOnUI(false);
+ mVrShell.setWebVrModeEnabled(false);
// TODO(bajones): Once VR Shell can be invoked outside of WebVR this
// should no longer exit the shell outright. Need a way to determine
// how VrShell was created.
@@ -328,7 +328,7 @@ public class VrShellDelegate {
setupVrModeWindowFlags();
StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites();
try {
- mVrShell.resumeOnUI();
+ mVrShell.resume();
} catch (IllegalArgumentException e) {
Log.e(TAG, "Unable to resume VrShell", e);
} finally {
@@ -445,7 +445,7 @@ public class VrShellDelegate {
mLastVRExit = SystemClock.uptimeMillis();
}
mActivity.setRequestedOrientation(mRestoreOrientation);
- mVrShell.pauseOnUI();
+ mVrShell.pause();
removeVrViews();
clearVrModeWindowFlags();
destroyVrShell();
@@ -485,14 +485,14 @@ public class VrShellDelegate {
LayoutParams params = new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT);
- decor.addView(mVrShell.getContainerOnUI(), params);
+ decor.addView(mVrShell.getContainer(), params);
mActivity.setUIVisibilityForVR(View.GONE);
}
private void removeVrViews() {
mActivity.setUIVisibilityForVR(View.VISIBLE);
FrameLayout decor = (FrameLayout) mActivity.getWindow().getDecorView();
- decor.removeView(mVrShell.getContainerOnUI());
+ decor.removeView(mVrShell.getContainer());
}
private void setupVrModeWindowFlags() {
@@ -521,7 +521,7 @@ public class VrShellDelegate {
*/
public void destroyVrShell() {
if (mVrShell != null) {
- mVrShell.teardownOnUI();
+ mVrShell.teardown();
mVrShell = null;
}
}

Powered by Google App Engine
This is Rietveld 408576698