org.chromium.chrome.browser.preferences.datareduction.DataReductionPreferences Java Examples
The following examples show how to use
org.chromium.chrome.browser.preferences.datareduction.DataReductionPreferences.
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: MainPreferences.java From delion with Apache License 2.0 | 5 votes |
private void updatePreferences() { if (getPreferenceScreen() != null) getPreferenceScreen().removeAll(); addPreferencesFromResource(R.xml.main_preferences); ChromeBasePreference autofillPref = (ChromeBasePreference) findPreference(PREF_AUTOFILL_SETTINGS); setOnOffSummary(autofillPref, PersonalDataManager.isAutofillEnabled()); autofillPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate); ChromeBasePreference passwordsPref = (ChromeBasePreference) findPreference(PREF_SAVED_PASSWORDS); if (PasswordUIView.shouldUseSmartLockBranding()) { passwordsPref.setTitle(getResources().getString( R.string.prefs_smart_lock_for_passwords)); } 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); } }
Example #2
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)); } }
Example #3
Source File: MainPreferences.java From 365browser with Apache License 2.0 | 4 votes |
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)); } }