org.chromium.chrome.browser.preferences.datareduction.DataReductionPromoScreen Java Examples

The following examples show how to use org.chromium.chrome.browser.preferences.datareduction.DataReductionPromoScreen. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ChromeTabbedActivity.java    From delion with Apache License 2.0 4 votes vote down vote up
@Override
public void finishNativeInitialization() {
    try {
        TraceEvent.begin("ChromeTabbedActivity.finishNativeInitialization");

        launchFirstRunExperience();

        ChromePreferenceManager preferenceManager = ChromePreferenceManager.getInstance(this);
        // Promos can only be shown when we start with ACTION_MAIN intent and
        // after FRE is complete.
        if (!mIntentWithEffect && FirstRunStatus.getFirstRunFlowComplete(this)) {
            // Only show promos on the second oppurtunity. This is because we show FRE on the
            // first oppurtunity, and we don't want to show such content back to back.
            if (preferenceManager.getPromosSkippedOnFirstStart()) {
                // Data reduction promo should be temporarily suppressed if the sign in promo is
                // shown to avoid nagging users too much.
                if (!SigninPromoUtil.launchSigninPromoIfNeeded(this)) {
                    DataReductionPromoScreen.launchDataReductionPromo(this);
                }
            } else {
                preferenceManager.setPromosSkippedOnFirstStart(true);
            }
        }

        refreshSignIn();

        initializeUI();

        // The dataset has already been created, we need to initialize our state.
        mTabModelSelectorImpl.notifyChanged();

        getWindow().setFeatureInt(Window.FEATURE_INDETERMINATE_PROGRESS,
                Window.PROGRESS_VISIBILITY_OFF);

        // Check for incognito tabs to handle the case where Chrome was swiped away in the
        // background.
        int incognitoCount = TabWindowManager.getInstance().getIncognitoTabCount();
        if (incognitoCount == 0) IncognitoNotificationManager.dismissIncognitoNotification();

        super.finishNativeInitialization();
    } finally {
        TraceEvent.end("ChromeTabbedActivity.finishNativeInitialization");
    }
}
 
Example #2
Source File: ChromeTabbedActivity.java    From AndroidChromium with Apache License 2.0 4 votes vote down vote up
@Override
public void finishNativeInitialization() {
    try {
        TraceEvent.begin("ChromeTabbedActivity.finishNativeInitialization");

        launchFirstRunExperience();

        refreshSignIn();

        ChromePreferenceManager preferenceManager = ChromePreferenceManager.getInstance(this);
        // Promos can only be shown when we start with ACTION_MAIN intent and
        // after FRE is complete.
        if (!mIntentWithEffect && FirstRunStatus.getFirstRunFlowComplete()) {
            // Only show promos on the second oppurtunity. This is because we show FRE on the
            // first oppurtunity, and we don't want to show such content back to back.
            if (preferenceManager.getPromosSkippedOnFirstStart()) {
                // Data reduction promo should be temporarily suppressed if the sign in promo is
                // shown to avoid nagging users too much.
                if (!SigninPromoUtil.launchSigninPromoIfNeeded(this)) {
                    DataReductionPromoScreen.launchDataReductionPromo(this);
                }
            } else {
                preferenceManager.setPromosSkippedOnFirstStart(true);
            }

            // Notify users experimenting with WebAPKs if they need to do extra steps to enable
            // WebAPKs.
            ChromeWebApkHost.launchWebApkRequirementsDialogIfNeeded(this);
        }

        initializeUI();

        // The dataset has already been created, we need to initialize our state.
        mTabModelSelectorImpl.notifyChanged();

        getWindow().setFeatureInt(Window.FEATURE_INDETERMINATE_PROGRESS,
                Window.PROGRESS_VISIBILITY_OFF);

        // Check for incognito tabs to handle the case where Chrome was swiped away in the
        // background.
        int incognitoCount = TabWindowManager.getInstance().getIncognitoTabCount();
        if (incognitoCount == 0) IncognitoNotificationManager.dismissIncognitoNotification();

        // LocaleManager can only function after the native library is loaded.
        mLocaleManager = LocaleManager.getInstance();
        mLocaleManager.showSearchEnginePromoIfNeeded(this);

        super.finishNativeInitialization();
    } finally {
        TraceEvent.end("ChromeTabbedActivity.finishNativeInitialization");
    }
}
 
Example #3
Source File: ChromeTabbedActivity.java    From 365browser with Apache License 2.0 4 votes vote down vote up
@Override
public void finishNativeInitialization() {
    try {
        TraceEvent.begin("ChromeTabbedActivity.finishNativeInitialization");

        refreshSignIn();

        initializeUI();

        // The dataset has already been created, we need to initialize our state.
        mTabModelSelectorImpl.notifyChanged();

        ApiCompatibilityUtils.setWindowIndeterminateProgress(getWindow());

        // Check for incognito tabs to handle the case where Chrome was swiped away in the
        // background.
        if (TabWindowManager.getInstance().canDestroyIncognitoProfile()) {
            IncognitoNotificationManager.dismissIncognitoNotification();
        }

        // LocaleManager can only function after the native library is loaded.
        mLocaleManager = LocaleManager.getInstance();
        boolean searchEnginePromoShown =
                mLocaleManager.showSearchEnginePromoIfNeeded(this, null);

        ChromePreferenceManager preferenceManager = ChromePreferenceManager.getInstance();
        // Promos can only be shown when we start with ACTION_MAIN intent and
        // after FRE is complete. Native initialization can finish before the FRE flow is
        // complete, and this will only show promos on the second opportunity. This is
        // because the FRE is shown on the first opportunity, and we don't want to show such
        // content back to back.
        if (!searchEnginePromoShown && !mIntentWithEffect
                && FirstRunStatus.getFirstRunFlowComplete()
                && preferenceManager.getPromosSkippedOnFirstStart()) {
            // Data reduction promo should be temporarily suppressed if the sign in promo is
            // shown to avoid nagging users too much.
            if (!SigninPromoUtil.launchSigninPromoIfNeeded(this)) {
                DataReductionPromoScreen.launchDataReductionPromo(this);
            }
        } else {
            preferenceManager.setPromosSkippedOnFirstStart(true);
        }

        super.finishNativeInitialization();
    } finally {
        TraceEvent.end("ChromeTabbedActivity.finishNativeInitialization");
    }
}