diff options
author | raymes <raymes@chromium.org> | 2015-04-26 20:00:25 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-27 03:00:34 +0000 |
commit | aa60872e346eaf354bb15dbd698546b1bdddd132 (patch) | |
tree | e50fc508527b8776881858d1068a2262516b1792 /components/content_settings | |
parent | a1b45c39dbf749704b4fd6e3aabcb6d8405cd6d9 (diff) | |
download | chromium_src-aa60872e346eaf354bb15dbd698546b1bdddd132.zip chromium_src-aa60872e346eaf354bb15dbd698546b1bdddd132.tar.gz chromium_src-aa60872e346eaf354bb15dbd698546b1bdddd132.tar.bz2 |
Remove most occurences of PrefRegistrySyncable::UNSYNCABLE_PREF
Now that we have added PrefRegistry registration functions that do not need to
accept a flags argument, passing PrefRegistrySyncable::UNSYNCABLE_PREF is
redundant and we can remove it altogether.
Ran the following command:
for x in $(git ls-files | grep -E "\.(cc|h|mm)$") ; do perl -0777 -i -pe 's/,[ \n]*(user_prefs::)+PrefRegistrySyncable::UNSYNCABLE_PREF//igs' $x ; done && git cl format
There are still some occurences that need to be manually fixed.
BUG=476800
Review URL: https://codereview.chromium.org/1102733002
Cr-Commit-Position: refs/heads/master@{#326993}
Diffstat (limited to 'components/content_settings')
4 files changed, 36 insertions, 74 deletions
diff --git a/components/content_settings/core/browser/content_settings_default_provider.cc b/components/content_settings/core/browser/content_settings_default_provider.cc index d6246c7..39c5a2e2 100644 --- a/components/content_settings/core/browser/content_settings_default_provider.cc +++ b/components/content_settings/core/browser/content_settings_default_provider.cc @@ -139,10 +139,8 @@ void DefaultProvider::RegisterProfilePrefs( // Whether the deprecated mediastream default setting has already been // migrated into microphone and camera default settings. - registry->RegisterBooleanPref( - prefs::kMigratedDefaultMediaStreamSetting, - false, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); + registry->RegisterBooleanPref(prefs::kMigratedDefaultMediaStreamSetting, + false); } DefaultProvider::DefaultProvider(PrefService* prefs, bool incognito) diff --git a/components/content_settings/core/browser/content_settings_policy_provider.cc b/components/content_settings/core/browser/content_settings_policy_provider.cc index 8c65dbd..a398a6c 100644 --- a/components/content_settings/core/browser/content_settings_policy_provider.cc +++ b/components/content_settings/core/browser/content_settings_policy_provider.cc @@ -122,68 +122,38 @@ namespace content_settings { // static void PolicyProvider::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { - registry->RegisterListPref(prefs::kManagedAutoSelectCertificateForUrls, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kManagedCookiesAllowedForUrls, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kManagedCookiesBlockedForUrls, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kManagedCookiesSessionOnlyForUrls, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kManagedImagesAllowedForUrls, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kManagedImagesBlockedForUrls, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kManagedJavaScriptAllowedForUrls, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kManagedJavaScriptBlockedForUrls, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kManagedPluginsAllowedForUrls, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kManagedPluginsBlockedForUrls, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kManagedPopupsAllowedForUrls, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kManagedPopupsBlockedForUrls, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kManagedNotificationsAllowedForUrls, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kManagedNotificationsBlockedForUrls, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); + registry->RegisterListPref(prefs::kManagedAutoSelectCertificateForUrls); + registry->RegisterListPref(prefs::kManagedCookiesAllowedForUrls); + registry->RegisterListPref(prefs::kManagedCookiesBlockedForUrls); + registry->RegisterListPref(prefs::kManagedCookiesSessionOnlyForUrls); + registry->RegisterListPref(prefs::kManagedImagesAllowedForUrls); + registry->RegisterListPref(prefs::kManagedImagesBlockedForUrls); + registry->RegisterListPref(prefs::kManagedJavaScriptAllowedForUrls); + registry->RegisterListPref(prefs::kManagedJavaScriptBlockedForUrls); + registry->RegisterListPref(prefs::kManagedPluginsAllowedForUrls); + registry->RegisterListPref(prefs::kManagedPluginsBlockedForUrls); + registry->RegisterListPref(prefs::kManagedPopupsAllowedForUrls); + registry->RegisterListPref(prefs::kManagedPopupsBlockedForUrls); + registry->RegisterListPref(prefs::kManagedNotificationsAllowedForUrls); + registry->RegisterListPref(prefs::kManagedNotificationsBlockedForUrls); // Preferences for default content setting policies. If a policy is not set of // the corresponding preferences below is set to CONTENT_SETTING_DEFAULT. - registry->RegisterIntegerPref( - prefs::kManagedDefaultCookiesSetting, - CONTENT_SETTING_DEFAULT, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterIntegerPref( - prefs::kManagedDefaultImagesSetting, - CONTENT_SETTING_DEFAULT, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterIntegerPref( - prefs::kManagedDefaultJavaScriptSetting, - CONTENT_SETTING_DEFAULT, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterIntegerPref( - prefs::kManagedDefaultPluginsSetting, - CONTENT_SETTING_DEFAULT, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterIntegerPref( - prefs::kManagedDefaultPopupsSetting, - CONTENT_SETTING_DEFAULT, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterIntegerPref( - prefs::kManagedDefaultGeolocationSetting, - CONTENT_SETTING_DEFAULT, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterIntegerPref( - prefs::kManagedDefaultNotificationsSetting, - CONTENT_SETTING_DEFAULT, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterIntegerPref( - prefs::kManagedDefaultMediaStreamSetting, - CONTENT_SETTING_DEFAULT, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); + registry->RegisterIntegerPref(prefs::kManagedDefaultCookiesSetting, + CONTENT_SETTING_DEFAULT); + registry->RegisterIntegerPref(prefs::kManagedDefaultImagesSetting, + CONTENT_SETTING_DEFAULT); + registry->RegisterIntegerPref(prefs::kManagedDefaultJavaScriptSetting, + CONTENT_SETTING_DEFAULT); + registry->RegisterIntegerPref(prefs::kManagedDefaultPluginsSetting, + CONTENT_SETTING_DEFAULT); + registry->RegisterIntegerPref(prefs::kManagedDefaultPopupsSetting, + CONTENT_SETTING_DEFAULT); + registry->RegisterIntegerPref(prefs::kManagedDefaultGeolocationSetting, + CONTENT_SETTING_DEFAULT); + registry->RegisterIntegerPref(prefs::kManagedDefaultNotificationsSetting, + CONTENT_SETTING_DEFAULT); + registry->RegisterIntegerPref(prefs::kManagedDefaultMediaStreamSetting, + CONTENT_SETTING_DEFAULT); } PolicyProvider::PolicyProvider(PrefService* prefs) : prefs_(prefs) { diff --git a/components/content_settings/core/browser/content_settings_pref_provider.cc b/components/content_settings/core/browser/content_settings_pref_provider.cc index 6f7c006..0b56355 100644 --- a/components/content_settings/core/browser/content_settings_pref_provider.cc +++ b/components/content_settings/core/browser/content_settings_pref_provider.cc @@ -112,15 +112,12 @@ void PrefProvider::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { registry->RegisterIntegerPref( prefs::kContentSettingsVersion, - ContentSettingsPattern::kContentSettingsPatternVersion, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); + ContentSettingsPattern::kContentSettingsPatternVersion); registry->RegisterDictionaryPref( prefs::kContentSettingsPatternPairs, user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); - registry->RegisterBooleanPref( - prefs::kMigratedContentSettingsPatternPairs, - false, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); + registry->RegisterBooleanPref(prefs::kMigratedContentSettingsPatternPairs, + false); for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { registry->RegisterDictionaryPref( diff --git a/components/content_settings/core/browser/host_content_settings_map.cc b/components/content_settings/core/browser/host_content_settings_map.cc index 39f70ee..73dd809 100644 --- a/components/content_settings/core/browser/host_content_settings_map.cc +++ b/components/content_settings/core/browser/host_content_settings_map.cc @@ -106,10 +106,7 @@ HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs, // static void HostContentSettingsMap::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { - registry->RegisterIntegerPref( - prefs::kContentSettingsWindowLastTabIndex, - 0, - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); + registry->RegisterIntegerPref(prefs::kContentSettingsWindowLastTabIndex, 0); // Register the prefs for the content settings providers. content_settings::DefaultProvider::RegisterProfilePrefs(registry); |