Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java |
| index 69a2e0afb71488c289c7bb44ec46d1ec3e7f597f..1a0c887581d12fd3596d50ddf42cd45c7a31d350 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java |
| @@ -330,6 +330,11 @@ public abstract class ChromeActivity extends AsyncInitializationActivity |
| public void postInflationStartup() { |
| super.postInflationStartup(); |
| + Intent intent = getIntent(); |
| + if (intent != null && getSavedInstanceState() == null) { |
| + VrShellDelegate.maybeHandleVrIntentPreNative(this, intent); |
| + } |
| + |
| mSnackbarManager = new SnackbarManager(this, null); |
| mDataUseSnackbarController = new DataUseSnackbarController(this, getSnackbarManager()); |
| @@ -913,6 +918,12 @@ public abstract class ChromeActivity extends AsyncInitializationActivity |
| super.onStopWithNative(); |
| } |
| + @Override |
| + protected void onNewIntent(Intent intent) { |
| + super.onNewIntent(intent); |
| + VrShellDelegate.maybeHandleVrIntentPreNative(this, intent); |
| + } |
| + |
| @Override |
| public void onNewIntentWithNative(Intent intent) { |
| mPictureInPictureController.cleanup(this); |
| @@ -920,6 +931,9 @@ public abstract class ChromeActivity extends AsyncInitializationActivity |
| super.onNewIntentWithNative(intent); |
| if (mIntentHandler.shouldIgnoreIntent(intent)) return; |
| + // We send this intent so that we can enter WebVr presentation mode if needed. This |
| + // call doesn't consume the intent because it also has the url that we need to load. |
| + VrShellDelegate.onNewIntentWithNative(this, intent); |
| mIntentHandler.onNewIntent(intent); |
| } |
| @@ -1215,7 +1229,8 @@ public abstract class ChromeActivity extends AsyncInitializationActivity |
| maybeRemoveWindowBackground(); |
| DownloadManagerService.getDownloadManagerService().onActivityLaunched(); |
| - VrShellDelegate.onNativeLibraryAvailable(); |
| + Intent intent = getSavedInstanceState() == null ? getIntent() : null; |
| + VrShellDelegate.onNativeLibraryAvailable(this, intent); |
|
Ted C
2017/07/14 00:12:05
I'd recommend not passing the intent in this call,
ymalik
2017/07/14 05:27:43
Thanks, Done.
|
| super.finishNativeInitialization(); |
| } |