当前位置: 首页>>代码示例>>Java>>正文


Java ProfileSyncService.isUsingSecondaryPassphrase方法代码示例

本文整理汇总了Java中org.chromium.chrome.browser.sync.ProfileSyncService.isUsingSecondaryPassphrase方法的典型用法代码示例。如果您正苦于以下问题:Java ProfileSyncService.isUsingSecondaryPassphrase方法的具体用法?Java ProfileSyncService.isUsingSecondaryPassphrase怎么用?Java ProfileSyncService.isUsingSecondaryPassphrase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.chromium.chrome.browser.sync.ProfileSyncService的用法示例。


在下文中一共展示了ProfileSyncService.isUsingSecondaryPassphrase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updatePreferences

import org.chromium.chrome.browser.sync.ProfileSyncService; //导入方法依赖的package包/类
private void updatePreferences() {
    if (getPreferenceScreen() != null) getPreferenceScreen().removeAll();
    addPreferencesFromResource(R.xml.main_preferences);

    addBlimpPreferences();

    if (TemplateUrlService.getInstance().isLoaded()) {
        updateSummary();
    } else {
        TemplateUrlService.getInstance().registerLoadListener(this);
        TemplateUrlService.getInstance().load();
        ChromeBasePreference searchEnginePref =
                (ChromeBasePreference) findPreference(PREF_SEARCH_ENGINE);
        searchEnginePref.setEnabled(false);
    }

    ChromeBasePreference autofillPref =
            (ChromeBasePreference) findPreference(PREF_AUTOFILL_SETTINGS);
    setOnOffSummary(autofillPref, PersonalDataManager.isAutofillEnabled());
    autofillPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);

    ChromeBasePreference passwordsPref =
            (ChromeBasePreference) findPreference(PREF_SAVED_PASSWORDS);

    ProfileSyncService syncService = ProfileSyncService.get();

    if (AndroidSyncSettings.isSyncEnabled(getActivity().getApplicationContext())
              && syncService.isBackendInitialized()
              && !syncService.isUsingSecondaryPassphrase()
              && ChromeFeatureList.isEnabled(VIEW_PASSWORDS)) {
        passwordsPref.setKey(PREF_MANAGE_ACCOUNT_LINK);
        passwordsPref.setTitle(R.string.redirect_to_passwords_text);
        passwordsPref.setSummary(R.string.redirect_to_passwords_link);
        passwordsPref.setOnPreferenceClickListener(this);
        passwordsPref.setManagedPreferenceDelegate(null);
    } else {
        if (PasswordUIView.shouldUseSmartLockBranding()) {
            passwordsPref.setTitle(getResources().getString(
                     R.string.prefs_smart_lock_for_passwords));
        } else {
            passwordsPref.setTitle(getResources().getString(
                      R.string.prefs_saved_passwords));
        }
        passwordsPref.setFragment(SavePasswordsPreferences.class.getCanonicalName());
        setOnOffSummary(passwordsPref,
                PrefServiceBridge.getInstance().isRememberPasswordsEnabled());
        passwordsPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
    }

    Preference homepagePref = findPreference(PREF_HOMEPAGE);
    if (HomepageManager.shouldShowHomepageSetting()) {
        setOnOffSummary(homepagePref,
                HomepageManager.getInstance(getActivity()).getPrefHomepageEnabled());
    } else {
        getPreferenceScreen().removePreference(homepagePref);
    }

    ChromeBasePreference dataReduction =
            (ChromeBasePreference) findPreference(PREF_DATA_REDUCTION);
    if (DataReductionProxySettings.getInstance().isDataReductionProxyAllowed()) {
        dataReduction.setSummary(
                DataReductionPreferences.generateSummary(getResources()));
        dataReduction.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
    } else {
        getPreferenceScreen().removePreference(dataReduction);
    }

    if (!SigninManager.get(getActivity()).isSigninSupported()) {
        getPreferenceScreen().removePreference(findPreference(PREF_SIGN_IN));
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:72,代码来源:MainPreferences.java

示例2: updatePreferences

import org.chromium.chrome.browser.sync.ProfileSyncService; //导入方法依赖的package包/类
private void updatePreferences() {
    if (getPreferenceScreen() != null) getPreferenceScreen().removeAll();

    PreferenceUtils.addPreferencesFromResource(this, R.xml.main_preferences);

    if (TemplateUrlService.getInstance().isLoaded()) {
        updateSummary();
    } else {
        TemplateUrlService.getInstance().registerLoadListener(this);
        TemplateUrlService.getInstance().load();
        ChromeBasePreference searchEnginePref =
                (ChromeBasePreference) findPreference(PREF_SEARCH_ENGINE);
        searchEnginePref.setEnabled(false);
    }

    ChromeBasePreference autofillPref =
            (ChromeBasePreference) findPreference(PREF_AUTOFILL_SETTINGS);
    autofillPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);

    ChromeBasePreference passwordsPref =
            (ChromeBasePreference) findPreference(PREF_SAVED_PASSWORDS);

    ProfileSyncService syncService = ProfileSyncService.get();

    if (AndroidSyncSettings.isSyncEnabled(getActivity().getApplicationContext())
            && syncService.isEngineInitialized() && !syncService.isUsingSecondaryPassphrase()
            && ChromeFeatureList.isEnabled(VIEW_PASSWORDS)) {
        passwordsPref.setKey(PREF_MANAGE_ACCOUNT_LINK);
        passwordsPref.setTitle(R.string.redirect_to_passwords_text);
        passwordsPref.setSummary(R.string.redirect_to_passwords_link);
        passwordsPref.setOnPreferenceClickListener(this);
        passwordsPref.setManagedPreferenceDelegate(null);
    } else {
        passwordsPref.setTitle(getResources().getString(R.string.prefs_saved_passwords));
        passwordsPref.setFragment(SavePasswordsPreferences.class.getCanonicalName());
        setOnOffSummary(passwordsPref,
                PrefServiceBridge.getInstance().isRememberPasswordsEnabled());
        passwordsPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
    }

    Preference homepagePref = findPreference(PREF_HOMEPAGE);
    if (HomepageManager.shouldShowHomepageSetting()) {
        setOnOffSummary(homepagePref,
                HomepageManager.getInstance(getActivity()).getPrefHomepageEnabled());
    } else {
        getPreferenceScreen().removePreference(homepagePref);
    }

    ChromeBasePreference dataReduction =
            (ChromeBasePreference) findPreference(PREF_DATA_REDUCTION);
    dataReduction.setSummary(DataReductionPreferences.generateSummary(getResources()));
    dataReduction.setManagedPreferenceDelegate(mManagedPreferenceDelegate);

    if (!SigninManager.get(getActivity()).isSigninSupported()) {
        getPreferenceScreen().removePreference(findPreference(PREF_SIGN_IN));
    }
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:58,代码来源:MainPreferences.java


注:本文中的org.chromium.chrome.browser.sync.ProfileSyncService.isUsingSecondaryPassphrase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。