Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java |
| index faa062f7a375273ce5796966e87b7b093dce6087..de40d66f0a9998b92b24c85fd7a0427f89db166d 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java |
| @@ -9,15 +9,12 @@ import android.app.Activity; |
| import android.content.Context; |
| import android.content.Intent; |
| import android.os.Bundle; |
| -import android.text.TextUtils; |
| import org.chromium.base.ApiCompatibilityUtils; |
| import org.chromium.base.CommandLine; |
| import org.chromium.base.FieldTrialList; |
| import org.chromium.base.VisibleForTesting; |
| import org.chromium.chrome.browser.ChromeSwitches; |
| -import org.chromium.chrome.browser.IntentHandler; |
| -import org.chromium.chrome.browser.IntentHandler.ExternalAppId; |
| import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; |
| import org.chromium.chrome.browser.preferences.PrefServiceBridge; |
| import org.chromium.chrome.browser.preferences.privacy.PrivacyPreferencesManager; |
| @@ -221,10 +218,11 @@ public abstract class FirstRunFlowSequencer { |
| * Checks if the First Run needs to be launched. |
| * @return The intent to launch the First Run Experience if necessary, or null. |
| * @param context The context. |
| - * @param fromIntent The intent that was used to launch Chrome. It contains the information of |
| - * the client to launch different types of the First Run Experience. |
| + * @param fromChromeIcon Whether Chrome is opened via the Chrome icon. |
| + * @param forLightweightFre Whether this is a check for the Lightweight First Run Experience. |
| */ |
| - public static Intent checkIfFirstRunIsNecessary(Context context, Intent fromIntent) { |
| + public static Intent checkIfFirstRunIsNecessary( |
| + Context context, boolean fromChromeIcon, boolean forLightweightFre) { |
| // If FRE is disabled (e.g. in tests), proceed directly to the intent handling. |
| if (CommandLine.getInstance().hasSwitch(ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE) |
| || ApiCompatibilityUtils.isDemoUser(context)) { |
| @@ -234,25 +232,17 @@ public abstract class FirstRunFlowSequencer { |
| // If Chrome isn't opened via the Chrome icon, and the user accepted the ToS |
| // in the Setup Wizard, skip any First Run Experience screens and proceed directly |
| // to the intent handling. |
| - final boolean fromChromeIcon = |
|
Bernhard Bauer
2016/08/16 23:20:08
Is there a reason you're moving this out to the ca
gogerald1
2016/08/17 14:44:10
Done. just made the parameter a little specific, m
|
| - fromIntent != null && TextUtils.equals(fromIntent.getAction(), Intent.ACTION_MAIN); |
| if (!fromChromeIcon && ToSAckedReceiver.checkAnyUserHasSeenToS(context)) return null; |
| final boolean baseFreComplete = FirstRunStatus.getFirstRunFlowComplete(context); |
| if (!baseFreComplete) { |
| - // Show full First Run Experience if Chrome is opened via Chrome icon or GSA (Google |
| - // Search App). |
| - if (fromChromeIcon |
| - || (fromIntent != null |
| - && IntentHandler.determineExternalIntentSource( |
| - context.getPackageName(), fromIntent) == ExternalAppId.GSA)) { |
| + if (!forLightweightFre) { |
|
Bernhard Bauer
2016/08/16 23:20:08
Invert the check to put the positive branch first?
gogerald1
2016/08/17 14:44:11
Done.
|
| return createGenericFirstRunIntent(context, fromChromeIcon); |
| - } |
| - |
| - // Show lightweight First Run Experience if the user has not accepted the ToS. |
| - if (!FirstRunStatus.shouldSkipWelcomePage(context) |
| - && !FirstRunStatus.getLightweightFirstRunFlowComplete(context)) { |
| - return createLightweightFirstRunIntent(context, fromChromeIcon); |
| + } else { |
| + if (!FirstRunStatus.shouldSkipWelcomePage(context) |
| + && !FirstRunStatus.getLightweightFirstRunFlowComplete(context)) { |
| + return createLightweightFirstRunIntent(context, fromChromeIcon); |
| + } |
| } |
| } |