Java Code Examples for org.chromium.chrome.browser.sync.ProfileSyncService#isBackendInitialized()
The following examples show how to use
org.chromium.chrome.browser.sync.ProfileSyncService#isBackendInitialized() .
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: ContextReporter.java From delion with Apache License 2.0 | 5 votes |
/** * Records an appropriate status via UMA given the current sync status. */ public static void reportSyncStatus(@Nullable ProfileSyncService syncService) { if (syncService == null || !syncService.isBackendInitialized()) { reportStatus(STATUS_SYNC_NOT_INITIALIZED); } else if (!syncService.getActiveDataTypes().contains(ModelType.TYPED_URLS)) { reportStatus(STATUS_SYNC_NOT_SYNCING_URLS); } else if (!syncService.getPassphraseType().equals(PassphraseType.KEYSTORE_PASSPHRASE)) { reportStatus(STATUS_SYNC_NOT_KEYSTORE_PASSPHRASE); } else { reportStatus(STATUS_SYNC_OTHER); } }
Example 2
Source File: ContextReporter.java From AndroidChromium with Apache License 2.0 | 5 votes |
/** * Records an appropriate status via UMA given the current sync status. */ public static void reportSyncStatus(@Nullable ProfileSyncService syncService) { if (syncService == null || !syncService.isBackendInitialized()) { reportStatus(STATUS_SYNC_NOT_INITIALIZED); } else if (!syncService.getActiveDataTypes().contains(ModelType.TYPED_URLS)) { reportStatus(STATUS_SYNC_NOT_SYNCING_URLS); } else if (!syncService.getPassphraseType().equals(PassphraseType.KEYSTORE_PASSPHRASE)) { reportStatus(STATUS_SYNC_NOT_KEYSTORE_PASSPHRASE); } else { reportStatus(STATUS_SYNC_OTHER); } }
Example 3
Source File: MainPreferences.java From AndroidChromium with Apache License 2.0 | 4 votes |
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)); } }