本文整理汇总了Java中org.chromium.chrome.browser.preferences.ChromePreferenceManager.setPromosSkippedOnFirstStart方法的典型用法代码示例。如果您正苦于以下问题:Java ChromePreferenceManager.setPromosSkippedOnFirstStart方法的具体用法?Java ChromePreferenceManager.setPromosSkippedOnFirstStart怎么用?Java ChromePreferenceManager.setPromosSkippedOnFirstStart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.chromium.chrome.browser.preferences.ChromePreferenceManager
的用法示例。
在下文中一共展示了ChromePreferenceManager.setPromosSkippedOnFirstStart方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: finishNativeInitialization
import org.chromium.chrome.browser.preferences.ChromePreferenceManager; //导入方法依赖的package包/类
@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");
}
}
示例2: finishNativeInitialization
import org.chromium.chrome.browser.preferences.ChromePreferenceManager; //导入方法依赖的package包/类
@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 (!SigninPromoScreen.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);
super.finishNativeInitialization();
if (getActivityTab() != null) {
DataReductionPreferences.launchDataReductionSSLInfoBar(
this, getActivityTab().getWebContents());
}
} finally {
TraceEvent.end("ChromeTabbedActivity.finishNativeInitialization");
}
}
示例3: finishNativeInitialization
import org.chromium.chrome.browser.preferences.ChromePreferenceManager; //导入方法依赖的package包/类
@Override
public void finishNativeInitialization() {
ChromePreferenceManager preferenceManager =
ChromePreferenceManager.getInstance(this);
if (isNewTabPage() && FirstRunStatus.getFirstRunFlowComplete(this)) {
// Only show promos on second NTP.
if (preferenceManager.getPromosSkippedOnFirstStart()) {
// Data reduction promo should be temporarily suppressed if the sign in promo is
// shown to avoid nagging users too much.
if (!SigninPromoScreen.launchSigninPromoIfNeeded(this)) {
DataReductionPromoScreen.launchDataReductionPromo(this);
}
} else {
preferenceManager.setPromosSkippedOnFirstStart(true);
}
}
FirstRunSignInProcessor.start(this);
if (!preferenceManager.hasAttemptedMigrationOnUpgrade()) {
InitializationObserver observer = new InitializationObserver(
ChromeApplication.getDocumentTabModelSelector().getModel(false)) {
@Override
protected void runImmediately() {
DocumentMigrationHelper.migrateTabsToDocumentForUpgrade(DocumentActivity.this,
DocumentMigrationHelper.FINALIZE_MODE_NO_ACTION);
}
@Override
public boolean isSatisfied(int currentState) {
return currentState == DocumentTabModelImpl.STATE_FULLY_LOADED;
}
@Override
public boolean isCanceled() {
return false;
}
};
observer.runWhenReady();
}
getWindow().setFeatureInt(Window.FEATURE_INDETERMINATE_PROGRESS,
Window.PROGRESS_VISIBILITY_OFF);
// Initialize the native-side TabModels so that the Profile is available when necessary.
ChromeApplication.getDocumentTabModelSelector().onNativeLibraryReady();
mTabInitializationObserver.runWhenReady();
if (mNeedsToBeAddedToTabModel) {
mNeedsToBeAddedToTabModel = false;
mTabModel.addTab(getIntent(), mDocumentTab);
getTabModelSelector().setTab(mDocumentTab);
}
super.finishNativeInitialization();
}
示例4: finishNativeInitialization
import org.chromium.chrome.browser.preferences.ChromePreferenceManager; //导入方法依赖的package包/类
@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");
}
}