android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener#org.chromium.base.CommandLine源码实例Demo

下面列出了android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener#org.chromium.base.CommandLine 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: 365browser   文件: ContextualSearchFieldTrial.java
private static boolean detectEnabled() {
    if (SysUtils.isLowEndDevice()) {
        return false;
    }

    // Allow this user-flippable flag to disable the feature.
    if (CommandLine.getInstance().hasSwitch(ChromeSwitches.DISABLE_CONTEXTUAL_SEARCH)) {
        return false;
    }

    // Allow this user-flippable flag to enable the feature.
    if (CommandLine.getInstance().hasSwitch(ChromeSwitches.ENABLE_CONTEXTUAL_SEARCH)) {
        return true;
    }

    // Allow disabling the feature remotely.
    if (getBooleanParam(DISABLED_PARAM)) {
        return false;
    }

    return true;
}
 
源代码2 项目: delion   文件: ChromeBrowserInitializer.java
private void preInflationStartup() {
    ThreadUtils.assertOnUiThread();
    if (mPreInflationStartupComplete) return;
    PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX, mApplication);

    // Ensure critical files are available, so they aren't blocked on the file-system
    // behind long-running accesses in next phase.
    // Don't do any large file access here!
    ContentApplication.initCommandLine(mApplication);
    waitForDebuggerIfNeeded();
    ChromeStrictMode.configureStrictMode();
    if (CommandLine.getInstance().hasSwitch(ChromeSwitches.ENABLE_WEBAPK)) {
        ChromeWebApkHost.init();
    }

    warmUpSharedPrefs();

    DeviceUtils.addDeviceSpecificUserAgentSwitch(mApplication);
    ApplicationStatus.registerStateListenerForAllActivities(
            createActivityStateListener());

    mPreInflationStartupComplete = true;
}
 
源代码3 项目: 365browser   文件: ApplicationInitialization.java
/**
 * Enable fullscreen related startup flags.
 * @param resources Resources to use while calculating initialization constants.
 * @param resControlContainerHeight The resource id for the height of the browser controls.
 */
public static void enableFullscreenFlags(
        Resources resources, Context context, int resControlContainerHeight) {
    ContentApplication.initCommandLine(context);

    CommandLine commandLine = CommandLine.getInstance();
    if (commandLine.hasSwitch(ChromeSwitches.DISABLE_FULLSCREEN)) return;

    TypedValue threshold = new TypedValue();
    resources.getValue(R.dimen.top_controls_show_threshold, threshold, true);
    commandLine.appendSwitchWithValue(
            ContentSwitches.TOP_CONTROLS_SHOW_THRESHOLD, threshold.coerceToString().toString());
    resources.getValue(R.dimen.top_controls_hide_threshold, threshold, true);
    commandLine.appendSwitchWithValue(
            ContentSwitches.TOP_CONTROLS_HIDE_THRESHOLD, threshold.coerceToString().toString());
}
 
源代码4 项目: delion   文件: ApplicationInitialization.java
/**
 * Enable fullscreen related startup flags.
 * @param resources Resources to use while calculating initialization constants.
 * @param resControlContainerHeight The resource id for the height of the top controls.
 */
public static void enableFullscreenFlags(
        Resources resources, Context context, int resControlContainerHeight) {
    ContentApplication.initCommandLine(context);

    CommandLine commandLine = CommandLine.getInstance();
    if (commandLine.hasSwitch(ChromeSwitches.DISABLE_FULLSCREEN)) return;

    TypedValue threshold = new TypedValue();
    resources.getValue(R.dimen.top_controls_show_threshold, threshold, true);
    commandLine.appendSwitchWithValue(
            ContentSwitches.TOP_CONTROLS_SHOW_THRESHOLD, threshold.coerceToString().toString());
    resources.getValue(R.dimen.top_controls_hide_threshold, threshold, true);
    commandLine.appendSwitchWithValue(
            ContentSwitches.TOP_CONTROLS_HIDE_THRESHOLD, threshold.coerceToString().toString());
}
 
源代码5 项目: 365browser   文件: ContextualSearchFieldTrial.java
/**
 * Returns an integer value for a Finch parameter, or the default value if no parameter exists
 * in the current configuration.  Also checks for a command-line switch with the same name.
 * @param paramName The name of the Finch parameter (or command-line switch) to get a value for.
 * @param defaultValue The default value to return when there's no param or switch.
 * @return An integer value -- either the param or the default.
 */
private static int getIntParamValueOrDefault(String paramName, int defaultValue) {
    String value = CommandLine.getInstance().getSwitchValue(paramName);
    if (TextUtils.isEmpty(value)) {
        value = VariationsAssociatedData.getVariationParamValue(FIELD_TRIAL_NAME, paramName);
    }
    if (!TextUtils.isEmpty(value)) {
        try {
            return Integer.parseInt(value);
        } catch (NumberFormatException e) {
            return defaultValue;
        }
    }

    return defaultValue;
}
 
源代码6 项目: 365browser   文件: PhysicalDisplayAndroid.java
private static boolean hasForcedDIPScale() {
    if (sForcedDIPScale == null) {
        String forcedScaleAsString = CommandLine.getInstance().getSwitchValue(
                DisplaySwitches.FORCE_DEVICE_SCALE_FACTOR);
        if (forcedScaleAsString == null) {
            sForcedDIPScale = Float.valueOf(0.0f);
        } else {
            boolean isInvalid = false;
            try {
                sForcedDIPScale = Float.valueOf(forcedScaleAsString);
                // Negative values are discarded.
                if (sForcedDIPScale.floatValue() <= 0.0f) isInvalid = true;
            } catch (NumberFormatException e) {
                // Strings that do not represent numbers are discarded.
                isInvalid = true;
            }

            if (isInvalid) {
                Log.w(TAG, "Ignoring invalid forced DIP scale '" + forcedScaleAsString + "'");
                sForcedDIPScale = Float.valueOf(0.0f);
            }
        }
    }
    return sForcedDIPScale.floatValue() > 0;
}
 
源代码7 项目: AndroidChromium   文件: InstantAppsHandler.java
/**
 * Cache whether the Instant Apps feature is enabled.
 * This should only be called with the native library loaded.
 */
public void cacheInstantAppsEnabled() {
    Context context = ContextUtils.getApplicationContext();
    boolean isEnabled = false;
    boolean wasEnabled = isEnabled(context);
    CommandLine instance = CommandLine.getInstance();
    if (instance.hasSwitch(ChromeSwitches.DISABLE_APP_LINK)) {
        isEnabled = false;
    } else if (instance.hasSwitch(ChromeSwitches.ENABLE_APP_LINK)) {
        isEnabled = true;
    } else {
        String experiment = FieldTrialList.findFullName(INSTANT_APPS_EXPERIMENT_NAME);
        if (INSTANT_APPS_DISABLED_ARM.equals(experiment)) {
            isEnabled = false;
        } else if (INSTANT_APPS_ENABLED_ARM.equals(experiment)) {
            isEnabled = true;
        }
    }

    if (isEnabled != wasEnabled) {
        ChromePreferenceManager.getInstance(context).setCachedInstantAppsEnabled(isEnabled);
    }
}
 
private static boolean detectEnabled() {
    if (SysUtils.isLowEndDevice()) {
        return false;
    }

    // Allow this user-flippable flag to disable the feature.
    if (CommandLine.getInstance().hasSwitch(ChromeSwitches.DISABLE_CONTEXTUAL_SEARCH)) {
        return false;
    }

    // Allow this user-flippable flag to enable the feature.
    if (CommandLine.getInstance().hasSwitch(ChromeSwitches.ENABLE_CONTEXTUAL_SEARCH)) {
        return true;
    }

    // Allow disabling the feature remotely.
    if (getBooleanParam(DISABLED_PARAM)) {
        return false;
    }

    return true;
}
 
/**
 * Returns an integer value for a Finch parameter, or the default value if no parameter exists
 * in the current configuration.  Also checks for a command-line switch with the same name.
 * @param paramName The name of the Finch parameter (or command-line switch) to get a value for.
 * @param defaultValue The default value to return when there's no param or switch.
 * @return An integer value -- either the param or the default.
 */
private static int getIntParamValueOrDefault(String paramName, int defaultValue) {
    String value = CommandLine.getInstance().getSwitchValue(paramName);
    if (TextUtils.isEmpty(value)) {
        value = VariationsAssociatedData.getVariationParamValue(FIELD_TRIAL_NAME, paramName);
    }
    if (!TextUtils.isEmpty(value)) {
        try {
            return Integer.parseInt(value);
        } catch (NumberFormatException e) {
            return defaultValue;
        }
    }

    return defaultValue;
}
 
/**
 * Enable fullscreen related startup flags.
 * @param resources Resources to use while calculating initialization constants.
 * @param resControlContainerHeight The resource id for the height of the browser controls.
 */
public static void enableFullscreenFlags(
        Resources resources, Context context, int resControlContainerHeight) {
    ContentApplication.initCommandLine(context);

    CommandLine commandLine = CommandLine.getInstance();
    if (commandLine.hasSwitch(ChromeSwitches.DISABLE_FULLSCREEN)) return;

    TypedValue threshold = new TypedValue();
    resources.getValue(R.dimen.top_controls_show_threshold, threshold, true);
    commandLine.appendSwitchWithValue(
            ContentSwitches.TOP_CONTROLS_SHOW_THRESHOLD, threshold.coerceToString().toString());
    resources.getValue(R.dimen.top_controls_hide_threshold, threshold, true);
    Log.w("renshuai: ", "hello" + threshold.coerceToString().toString());
    commandLine.appendSwitchWithValue(
            ContentSwitches.TOP_CONTROLS_HIDE_THRESHOLD, threshold.coerceToString().toString());

}
 
源代码11 项目: 365browser   文件: FirstRunFlowSequencer.java
/**
 * Starts determining parameters for the First Run.
 * Once finished, calls onFlowIsKnown().
 */
public void start() {
    if (CommandLine.getInstance().hasSwitch(ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE)
            || ApiCompatibilityUtils.isDemoUser(mActivity)) {
        onFlowIsKnown(null);
        return;
    }

    new AndroidEduAndChildAccountHelper() {
        @Override
        public void onParametersReady() {
            initializeSharedState(isAndroidEduDevice(), hasChildAccount());
            processFreEnvironmentPreNative();
        }
    }.start(mActivity.getApplicationContext());
}
 
源代码12 项目: AndroidChromium   文件: FirstRunFlowSequencer.java
/**
 * Starts determining parameters for the First Run.
 * Once finished, calls onFlowIsKnown().
 */
public void start() {
    if (CommandLine.getInstance().hasSwitch(ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE)
            || ApiCompatibilityUtils.isDemoUser(mActivity)) {
        onFlowIsKnown(null);
        return;
    }

    if (!mLaunchProperties.getBoolean(FirstRunActivity.EXTRA_USE_FRE_FLOW_SEQUENCER)) {
        onFlowIsKnown(mLaunchProperties);
        return;
    }

    new AndroidEduAndChildAccountHelper() {
        @Override
        public void onParametersReady() {
            processFreEnvironment(isAndroidEduDevice(), hasChildAccount());
        }
    }.start(mActivity.getApplicationContext());
}
 
源代码13 项目: 365browser   文件: ChromeTabbedActivity.java
@Override
public void onNewIntentWithNative(Intent intent) {
    try {
        TraceEvent.begin("ChromeTabbedActivity.onNewIntentWithNative");

        super.onNewIntentWithNative(intent);
        if (isMainIntentFromLauncher(intent)) {
            if (IntentHandler.getUrlFromIntent(intent) == null) {
                maybeLaunchNtpFromMainIntent(intent);
            }
            logMainIntentBehavior(intent);
        }

        if (CommandLine.getInstance().hasSwitch(ContentSwitches.ENABLE_TEST_INTENTS)) {
            handleDebugIntent(intent);
        }
    } finally {
        TraceEvent.end("ChromeTabbedActivity.onNewIntentWithNative");
    }
}
 
源代码14 项目: delion   文件: NotificationPlatformBridge.java
/**
 * Determines whether to use standard notification layouts, using NotificationCompat.Builder,
 * or custom layouts using Chrome's own templates.
 *
 * The --{enable,disable}-web-notification-custom-layouts command line flags take precedence.
 *
 * @return Whether custom layouts should be used.
 */
@VisibleForTesting
static boolean useCustomLayouts() {
    CommandLine commandLine = CommandLine.getInstance();
    if (commandLine.hasSwitch(ChromeSwitches.ENABLE_WEB_NOTIFICATION_CUSTOM_LAYOUTS)) {
        return true;
    }
    if (commandLine.hasSwitch(ChromeSwitches.DISABLE_WEB_NOTIFICATION_CUSTOM_LAYOUTS)) {
        return false;
    }
    if (Build.VERSION.CODENAME.equals("N") || Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
        return false;
    }
    return true;
}
 
源代码15 项目: delion   文件: PartnerBrowserCustomizations.java
/**
 * @return Home page URL from Android provider. If null, that means either there is no homepage
 *         provider or provider set it to null to disable homepage.
 */
public static String getHomePageUrl() {
    CommandLine commandLine = CommandLine.getInstance();
    if (commandLine.hasSwitch(ChromeSwitches.PARTNER_HOMEPAGE_FOR_TESTING)) {
        return commandLine.getSwitchValue(ChromeSwitches.PARTNER_HOMEPAGE_FOR_TESTING);
    }
    return sHomepage;
}
 
源代码16 项目: delion   文件: TabContentManager.java
/**
 * @param context               The context that this cache is created in.
 * @param resourceId            The resource that this value might be defined in.
 * @param commandLineSwitch     The switch for which we would like to extract value from.
 * @return the value of an integer resource.  If the value is overridden on the command line
 * with the given switch, return the override instead.
 */
private static int getIntegerResourceWithOverride(Context context, int resourceId,
        String commandLineSwitch) {
    int val = context.getResources().getInteger(resourceId);
    String switchCount = CommandLine.getInstance().getSwitchValue(commandLineSwitch);
    if (switchCount != null) {
        int count = Integer.parseInt(switchCount);
        val = count;
    }
    return val;
}
 
源代码17 项目: delion   文件: ReaderModeManager.java
/**
 * @return Whether Reader mode and its new UI are enabled.
 * @param context A context
 */
public static boolean isEnabled(Context context) {
    if (context == null) return false;

    boolean enabled = CommandLine.getInstance().hasSwitch(ChromeSwitches.ENABLE_DOM_DISTILLER)
            && !CommandLine.getInstance().hasSwitch(
                    ChromeSwitches.DISABLE_READER_MODE_BOTTOM_BAR)
            && !DeviceFormFactor.isTablet(context)
            && DomDistillerTabUtils.isDistillerHeuristicsEnabled()
            && !SysUtils.isLowEndDevice();
    return enabled;
}
 
源代码18 项目: delion   文件: DeviceClassManager.java
/**
 * The {@link DeviceClassManager} constructor should be self contained and
 * rely on system information and command line flags.
 */
private DeviceClassManager() {
    // Device based configurations.
    if (SysUtils.isLowEndDevice()) {
        mEnableSnapshots = false;
        mEnableLayerDecorationCache = true;
        mEnableAccessibilityLayout = true;
        mEnableAnimations = false;
        mEnablePrerendering = false;
        mEnableToolbarSwipe = false;
        mDisableDomainReliability = true;
    } else {
        mEnableSnapshots = true;
        mEnableLayerDecorationCache = true;
        mEnableAccessibilityLayout = false;
        mEnableAnimations = true;
        mEnablePrerendering = true;
        mEnableToolbarSwipe = true;
        mDisableDomainReliability = false;
    }

    if (DeviceFormFactor.isTablet(ContextUtils.getApplicationContext())) {
        mEnableAccessibilityLayout = false;
    }

    // Flag based configurations.
    CommandLine commandLine = CommandLine.getInstance();
    mEnableAccessibilityLayout |= commandLine
            .hasSwitch(ChromeSwitches.ENABLE_ACCESSIBILITY_TAB_SWITCHER);
    mEnableFullscreen =
            !commandLine.hasSwitch(ChromeSwitches.DISABLE_FULLSCREEN);
    mEnableToolbarSwipeInDocumentMode =
            commandLine.hasSwitch(ChromeSwitches.ENABLE_TOOLBAR_SWIPE_IN_DOCUMENT_MODE);

    // Related features.
    if (mEnableAccessibilityLayout) {
        mEnableAnimations = false;
    }
}
 
源代码19 项目: 365browser   文件: CustomTabsConnection.java
/**
 * <strong>DO NOT CALL</strong>
 * Public to be instanciable from {@link ChromeApplication}. This is however
 * intended to be private.
 */
public CustomTabsConnection(Application application) {
    super();
    mApplication = application;
    mClientManager = new ClientManager(mApplication);
    mLogRequests = CommandLine.getInstance().hasSwitch(LOG_SERVICE_REQUESTS);
}
 
源代码20 项目: delion   文件: ChromeBrowserInitializer.java
private void waitForDebuggerIfNeeded() {
    if (CommandLine.getInstance().hasSwitch(BaseSwitches.WAIT_FOR_JAVA_DEBUGGER)) {
        Log.e(TAG, "Waiting for Java debugger to connect...");
        android.os.Debug.waitForDebugger();
        Log.e(TAG, "Java debugger connected. Resuming execution.");
    }
}
 
源代码21 项目: 365browser   文件: ContextualSearchFieldTrial.java
/**
 * Gets a boolean Finch parameter, assuming the <paramName>="true" format.  Also checks for a
 * command-line switch with the same name, for easy local testing.
 * @param paramName The name of the Finch parameter (or command-line switch) to get a value for.
 * @return Whether the Finch param is defined with a value "true", if there's a command-line
 *         flag present with any value.
 */
private static boolean getBooleanParam(String paramName) {
    if (CommandLine.getInstance().hasSwitch(paramName)) {
        return true;
    }
    return TextUtils.equals(ENABLED_VALUE,
            VariationsAssociatedData.getVariationParamValue(FIELD_TRIAL_NAME, paramName));
}
 
源代码22 项目: 365browser   文件: FeatureUtilities.java
/**
 * @return True if tab model merging for Android N+ is enabled.
 */
public static boolean isTabModelMergingEnabled() {
    if (CommandLine.getInstance().hasSwitch(ChromeSwitches.DISABLE_TAB_MERGING_FOR_TESTING)) {
        return false;
    }
    return Build.VERSION.SDK_INT > Build.VERSION_CODES.M;
}
 
源代码23 项目: delion   文件: ContextualSearchFieldTrial.java
/**
 * Gets a boolean Finch parameter, assuming the <paramName>="true" format.  Also checks for a
 * command-line switch with the same name, for easy local testing.
 * @param paramName The name of the Finch parameter (or command-line switch) to get a value for.
 * @return Whether the Finch param is defined with a value "true", if there's a command-line
 *         flag present with any value.
 */
private static boolean getBooleanParam(String paramName) {
    if (CommandLine.getInstance().hasSwitch(paramName)) {
        return true;
    }
    return TextUtils.equals(ENABLED_VALUE,
            VariationsAssociatedData.getVariationParamValue(FIELD_TRIAL_NAME, paramName));
}
 
源代码24 项目: 365browser   文件: UpdateMenuItemHelper.java
/**
 * Gets a boolean VariationsAssociatedData parameter, assuming the <paramName>="true" format.
 * Also checks for a command-line switch with the same name, for easy local testing.
 * @param paramName The name of the parameter (or command-line switch) to get a value for.
 * @return Whether the param is defined with a value "true", if there's a command-line
 *         flag present with any value.
 */
private static boolean getBooleanParam(String paramName) {
    if (CommandLine.getInstance().hasSwitch(paramName)) {
        return true;
    }
    return TextUtils.equals(ENABLED_VALUE,
            VariationsAssociatedData.getVariationParamValue(FIELD_TRIAL_NAME, paramName));
}
 
源代码25 项目: 365browser   文件: UpdateMenuItemHelper.java
/**
 * Gets a String VariationsAssociatedData parameter. Also checks for a command-line switch with
 * the same name, for easy local testing.
 * @param paramName The name of the parameter (or command-line switch) to get a value for.
 * @return The command-line flag value if present, or the param is value if present.
 */
private static String getStringParamValue(String paramName) {
    String value = CommandLine.getInstance().getSwitchValue(paramName);
    if (TextUtils.isEmpty(value)) {
        value = VariationsAssociatedData.getVariationParamValue(FIELD_TRIAL_NAME, paramName);
    }
    return value;
}
 
源代码26 项目: delion   文件: UpdateMenuItemHelper.java
/**
 * Gets a boolean VariationsAssociatedData parameter, assuming the <paramName>="true" format.
 * Also checks for a command-line switch with the same name, for easy local testing.
 * @param paramName The name of the parameter (or command-line switch) to get a value for.
 * @return Whether the param is defined with a value "true", if there's a command-line
 *         flag present with any value.
 */
private static boolean getBooleanParam(String paramName) {
    if (CommandLine.getInstance().hasSwitch(paramName)) {
        return true;
    }
    return TextUtils.equals(ENABLED_VALUE,
            VariationsAssociatedData.getVariationParamValue(FIELD_TRIAL_NAME, paramName));
}
 
源代码27 项目: delion   文件: UpdateMenuItemHelper.java
/**
 * Gets a String VariationsAssociatedData parameter. Also checks for a command-line switch with
 * the same name, for easy local testing.
 * @param paramName The name of the parameter (or command-line switch) to get a value for.
 * @return The command-line flag value if present, or the param is value if present.
 */
private static String getStringParamValue(String paramName) {
    String value = CommandLine.getInstance().getSwitchValue(paramName);
    if (TextUtils.isEmpty(value)) {
        value = VariationsAssociatedData.getVariationParamValue(FIELD_TRIAL_NAME, paramName);
    }
    return value;
}
 
源代码28 项目: delion   文件: FirstRunFlowSequencer.java
/**
 * 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.
 */
public static Intent checkIfFirstRunIsNecessary(Context context, Intent fromIntent) {
    // If FRE is disabled (e.g. in tests), proceed directly to the intent handling.
    if (CommandLine.getInstance().hasSwitch(ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE)) {
        return null;
    }

    // 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 =
            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)) {
            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);
        }
    }

    // Promo pages are removed, so there is nothing else to show in FRE.
    return null;
}
 
源代码29 项目: 365browser   文件: FirstRunFlowSequencer.java
/**
 * Checks if the First Run needs to be launched.
 * @param context The context.
 * @param fromIntent The intent that was used to launch Chrome.
 * @param forLightweightFre Whether this is a check for the Lightweight First Run Experience.
 * @return The intent to launch the First Run Experience if necessary, or null.
 */
@Nullable
public static Intent checkIfFirstRunIsNecessary(
        Context context, Intent fromIntent, 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)) {
        return null;
    }

    if (fromIntent != null && fromIntent.getBooleanExtra(SKIP_FIRST_RUN_EXPERIENCE, false)) {
        return null;
    }

    // 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 =
            fromIntent != null && TextUtils.equals(fromIntent.getAction(), Intent.ACTION_MAIN);
    if (!fromChromeIcon && ToSAckedReceiver.checkAnyUserHasSeenToS(context)) return null;

    final boolean baseFreComplete = FirstRunStatus.getFirstRunFlowComplete();
    if (!baseFreComplete) {
        if (forLightweightFre
                && CommandLine.getInstance().hasSwitch(
                           ChromeSwitches.ENABLE_LIGHTWEIGHT_FIRST_RUN_EXPERIENCE)) {
            if (!FirstRunStatus.shouldSkipWelcomePage()
                    && !FirstRunStatus.getLightweightFirstRunFlowComplete()) {
                return createLightweightFirstRunIntent(context, fromChromeIcon);
            }
        } else {
            return createGenericFirstRunIntent(context, fromChromeIcon);
        }
    }

    // Promo pages are removed, so there is nothing else to show in FRE.
    return null;
}
 
源代码30 项目: delion   文件: ChromeActivity.java
@Override
public void initializeState() {
    super.initializeState();
    IntentHandler.setTestIntentsEnabled(
            CommandLine.getInstance().hasSwitch(ContentSwitches.ENABLE_TEST_INTENTS));
    mIntentHandler = new IntentHandler(createIntentHandlerDelegate(), getPackageName());
}