Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java |
| index 8314fded45293736ea14b4935852ab2f8a8440a7..2ad015283dcbb6e96a60659db604ab8a3788e34f 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java |
| @@ -35,6 +35,7 @@ import org.chromium.base.library_loader.ProcessInitException; |
| import org.chromium.chrome.R; |
| import org.chromium.chrome.browser.ChromeApplication; |
| import org.chromium.chrome.browser.WarmupManager; |
| +import org.chromium.chrome.browser.firstrun.FirstRunFlowSequencer; |
| import org.chromium.chrome.browser.metrics.MemoryUma; |
| import org.chromium.chrome.browser.profiles.Profile; |
| import org.chromium.chrome.browser.tabmodel.DocumentModeAssassin; |
| @@ -247,8 +248,13 @@ public abstract class AsyncInitializationActivity extends AppCompatActivity impl |
| } |
| if (!isStartedUpCorrectly(getIntent())) { |
| - super.onCreate(null); |
| - ApiCompatibilityUtils.finishAndRemoveTask(this); |
| + abortLaunch(); |
| + return; |
| + } |
| + |
| + if (requiresFirstRunToBeCompleted(getIntent()) |
| + && FirstRunFlowSequencer.launch(this, getIntent(), false)) { |
| + abortLaunch(); |
| return; |
| } |
| @@ -271,6 +277,11 @@ public abstract class AsyncInitializationActivity extends AppCompatActivity impl |
| } |
| } |
| + private void abortLaunch() { |
| + super.onCreate(null); |
|
Yusuf
2017/04/20 18:19:10
should we be worried about this getting called twi
gone
2017/04/21 00:23:53
We always return after calling super.onCreate().
|
| + ApiCompatibilityUtils.finishAndRemoveTask(this); |
| + } |
| + |
| /** |
| * Call to begin loading the library, if it was delayed. |
| */ |
| @@ -304,6 +315,14 @@ public abstract class AsyncInitializationActivity extends AppCompatActivity impl |
| } |
| /** |
| + * Overriding this function is almost always wrong. |
| + * @return Whether or not the user needs to go through First Run before using this Activity. |
| + */ |
| + protected boolean requiresFirstRunToBeCompleted(Intent intent) { |
| + return true; |
| + } |
| + |
| + /** |
| * Whether or not the Activity was started up via a valid Intent. |
| */ |
| protected boolean isStartedUpCorrectly(Intent intent) { |