diff options
author | deepak.m1 <deepak.m1@samsung.com> | 2015-08-12 01:48:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-12 08:49:32 +0000 |
commit | 6a6e5010e06e811d50e8d61a756b7e02eb151940 (patch) | |
tree | 1504467e3de46c12800ba42f33b569c8651718c8 /components/content_settings | |
parent | f761879e77165f91bf2742a63f57a13791a19780 (diff) | |
download | chromium_src-6a6e5010e06e811d50e8d61a756b7e02eb151940.zip chromium_src-6a6e5010e06e811d50e8d61a756b7e02eb151940.tar.gz chromium_src-6a6e5010e06e811d50e8d61a756b7e02eb151940.tar.bz2 |
Arranging the Pref Names in lexicographically order.
This is for arranging the pref names in proper order to get better readability.
BUG=519994
Review URL: https://codereview.chromium.org/1286963002
Cr-Commit-Position: refs/heads/master@{#342994}
Diffstat (limited to 'components/content_settings')
-rw-r--r-- | components/content_settings/core/browser/content_settings_policy_provider.cc | 69 | ||||
-rw-r--r-- | components/content_settings/core/common/pref_names.cc | 24 |
2 files changed, 47 insertions, 46 deletions
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 7206a1f..f7026e3 100644 --- a/components/content_settings/core/browser/content_settings_policy_provider.cc +++ b/components/content_settings/core/browser/content_settings_policy_provider.cc @@ -65,14 +65,14 @@ const PrefsForManagedContentSettingsMapEntry CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_ALLOW }, { - prefs::kManagedCookiesSessionOnlyForUrls, - CONTENT_SETTINGS_TYPE_COOKIES, - CONTENT_SETTING_SESSION_ONLY - }, { prefs::kManagedCookiesBlockedForUrls, CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_BLOCK }, { + prefs::kManagedCookiesSessionOnlyForUrls, + CONTENT_SETTINGS_TYPE_COOKIES, + CONTENT_SETTING_SESSION_ONLY + }, { prefs::kManagedImagesAllowedForUrls, CONTENT_SETTINGS_TYPE_IMAGES, CONTENT_SETTING_ALLOW @@ -89,6 +89,14 @@ const PrefsForManagedContentSettingsMapEntry CONTENT_SETTINGS_TYPE_JAVASCRIPT, CONTENT_SETTING_BLOCK }, { + prefs::kManagedNotificationsAllowedForUrls, + CONTENT_SETTINGS_TYPE_NOTIFICATIONS, + CONTENT_SETTING_ALLOW + }, { + prefs::kManagedNotificationsBlockedForUrls, + CONTENT_SETTINGS_TYPE_NOTIFICATIONS, + CONTENT_SETTING_BLOCK + }, { prefs::kManagedPluginsAllowedForUrls, CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_ALLOW @@ -104,14 +112,6 @@ const PrefsForManagedContentSettingsMapEntry prefs::kManagedPopupsBlockedForUrls, CONTENT_SETTINGS_TYPE_POPUPS, CONTENT_SETTING_BLOCK - }, { - prefs::kManagedNotificationsAllowedForUrls, - CONTENT_SETTINGS_TYPE_NOTIFICATIONS, - CONTENT_SETTING_ALLOW - }, { - prefs::kManagedNotificationsBlockedForUrls, - CONTENT_SETTINGS_TYPE_NOTIFICATIONS, - CONTENT_SETTING_BLOCK } }; @@ -130,30 +130,30 @@ void PolicyProvider::RegisterProfilePrefs( registry->RegisterListPref(prefs::kManagedImagesBlockedForUrls); registry->RegisterListPref(prefs::kManagedJavaScriptAllowedForUrls); registry->RegisterListPref(prefs::kManagedJavaScriptBlockedForUrls); + registry->RegisterListPref(prefs::kManagedNotificationsAllowedForUrls); + registry->RegisterListPref(prefs::kManagedNotificationsBlockedForUrls); 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); + registry->RegisterIntegerPref(prefs::kManagedDefaultGeolocationSetting, + 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); + registry->RegisterIntegerPref(prefs::kManagedDefaultPluginsSetting, + CONTENT_SETTING_DEFAULT); + registry->RegisterIntegerPref(prefs::kManagedDefaultPopupsSetting, + CONTENT_SETTING_DEFAULT); } PolicyProvider::PolicyProvider(PrefService* prefs) : prefs_(prefs) { @@ -165,22 +165,23 @@ PolicyProvider::PolicyProvider(PrefService* prefs) : prefs_(prefs) { base::Bind(&PolicyProvider::OnPreferenceChanged, base::Unretained(this)); pref_change_registrar_.Add( prefs::kManagedAutoSelectCertificateForUrls, callback); - pref_change_registrar_.Add(prefs::kManagedCookiesBlockedForUrls, callback); pref_change_registrar_.Add(prefs::kManagedCookiesAllowedForUrls, callback); + pref_change_registrar_.Add(prefs::kManagedCookiesBlockedForUrls, callback); pref_change_registrar_.Add( prefs::kManagedCookiesSessionOnlyForUrls, callback); - pref_change_registrar_.Add(prefs::kManagedImagesBlockedForUrls, callback); pref_change_registrar_.Add(prefs::kManagedImagesAllowedForUrls, callback); - pref_change_registrar_.Add(prefs::kManagedJavaScriptBlockedForUrls, callback); + pref_change_registrar_.Add(prefs::kManagedImagesBlockedForUrls, callback); pref_change_registrar_.Add(prefs::kManagedJavaScriptAllowedForUrls, callback); - pref_change_registrar_.Add(prefs::kManagedPluginsBlockedForUrls, callback); - pref_change_registrar_.Add(prefs::kManagedPluginsAllowedForUrls, callback); - pref_change_registrar_.Add(prefs::kManagedPopupsBlockedForUrls, callback); - pref_change_registrar_.Add(prefs::kManagedPopupsAllowedForUrls, callback); + pref_change_registrar_.Add(prefs::kManagedJavaScriptBlockedForUrls, callback); + pref_change_registrar_.Add( prefs::kManagedNotificationsAllowedForUrls, callback); pref_change_registrar_.Add( prefs::kManagedNotificationsBlockedForUrls, callback); + pref_change_registrar_.Add(prefs::kManagedPluginsAllowedForUrls, callback); + pref_change_registrar_.Add(prefs::kManagedPluginsBlockedForUrls, callback); + pref_change_registrar_.Add(prefs::kManagedPopupsAllowedForUrls, callback); + pref_change_registrar_.Add(prefs::kManagedPopupsBlockedForUrls, callback); // The following preferences are only used to indicate if a default content // setting is managed and to hold the managed default setting value. If the // value for any of the following preferences is set then the corresponding @@ -189,16 +190,16 @@ PolicyProvider::PolicyProvider(PrefService* prefs) : prefs_(prefs) { // is managed any user defined exceptions (patterns) for this type are // ignored. pref_change_registrar_.Add(prefs::kManagedDefaultCookiesSetting, callback); - pref_change_registrar_.Add(prefs::kManagedDefaultImagesSetting, callback); - pref_change_registrar_.Add(prefs::kManagedDefaultJavaScriptSetting, callback); - pref_change_registrar_.Add(prefs::kManagedDefaultPluginsSetting, callback); - pref_change_registrar_.Add(prefs::kManagedDefaultPopupsSetting, callback); pref_change_registrar_.Add( prefs::kManagedDefaultGeolocationSetting, callback); + pref_change_registrar_.Add(prefs::kManagedDefaultImagesSetting, callback); + pref_change_registrar_.Add(prefs::kManagedDefaultJavaScriptSetting, callback); pref_change_registrar_.Add( prefs::kManagedDefaultNotificationsSetting, callback); pref_change_registrar_.Add( prefs::kManagedDefaultMediaStreamSetting, callback); + pref_change_registrar_.Add(prefs::kManagedDefaultPluginsSetting, callback); + pref_change_registrar_.Add(prefs::kManagedDefaultPopupsSetting, callback); } PolicyProvider::~PolicyProvider() { @@ -444,12 +445,12 @@ void PolicyProvider::OnPreferenceChanged(const std::string& name) { name == prefs::kManagedImagesBlockedForUrls || name == prefs::kManagedJavaScriptAllowedForUrls || name == prefs::kManagedJavaScriptBlockedForUrls || + name == prefs::kManagedNotificationsAllowedForUrls || + name == prefs::kManagedNotificationsBlockedForUrls || name == prefs::kManagedPluginsAllowedForUrls || name == prefs::kManagedPluginsBlockedForUrls || name == prefs::kManagedPopupsAllowedForUrls || - name == prefs::kManagedPopupsBlockedForUrls || - name == prefs::kManagedNotificationsAllowedForUrls || - name == prefs::kManagedNotificationsBlockedForUrls) { + name == prefs::kManagedPopupsBlockedForUrls) { ReadManagedContentSettings(true); ReadManagedDefaultSettings(); } diff --git a/components/content_settings/core/common/pref_names.cc b/components/content_settings/core/common/pref_names.cc index 50b8ab0..3b84e71 100644 --- a/components/content_settings/core/common/pref_names.cc +++ b/components/content_settings/core/common/pref_names.cc @@ -27,23 +27,25 @@ const char kMigratedDefaultMediaStreamSetting[] = // content settings. const char kManagedDefaultCookiesSetting[] = "profile.managed_default_content_settings.cookies"; +const char kManagedDefaultGeolocationSetting[] = + "profile.managed_default_content_settings.geolocation"; const char kManagedDefaultImagesSetting[] = "profile.managed_default_content_settings.images"; const char kManagedDefaultJavaScriptSetting[] = "profile.managed_default_content_settings.javascript"; -const char kManagedDefaultPluginsSetting[] = - "profile.managed_default_content_settings.plugins"; -const char kManagedDefaultPopupsSetting[] = - "profile.managed_default_content_settings.popups"; -const char kManagedDefaultGeolocationSetting[] = - "profile.managed_default_content_settings.geolocation"; const char kManagedDefaultNotificationsSetting[] = "profile.managed_default_content_settings.notifications"; const char kManagedDefaultMediaStreamSetting[] = "profile.managed_default_content_settings.media_stream"; +const char kManagedDefaultPluginsSetting[] = + "profile.managed_default_content_settings.plugins"; +const char kManagedDefaultPopupsSetting[] = + "profile.managed_default_content_settings.popups"; // Preferences that are exclusively used to store managed // content settings patterns. +const char kManagedAutoSelectCertificateForUrls[] = + "profile.managed_auto_select_certificate_for_urls"; const char kManagedCookiesAllowedForUrls[] = "profile.managed_cookies_allowed_for_urls"; const char kManagedCookiesBlockedForUrls[] = @@ -58,6 +60,10 @@ const char kManagedJavaScriptAllowedForUrls[] = "profile.managed_javascript_allowed_for_urls"; const char kManagedJavaScriptBlockedForUrls[] = "profile.managed_javascript_blocked_for_urls"; +const char kManagedNotificationsAllowedForUrls[] = + "profile.managed_notifications_allowed_for_urls"; +const char kManagedNotificationsBlockedForUrls[] = + "profile.managed_notifications_blocked_for_urls"; const char kManagedPluginsAllowedForUrls[] = "profile.managed_plugins_allowed_for_urls"; const char kManagedPluginsBlockedForUrls[] = @@ -66,11 +72,5 @@ const char kManagedPopupsAllowedForUrls[] = "profile.managed_popups_allowed_for_urls"; const char kManagedPopupsBlockedForUrls[] = "profile.managed_popups_blocked_for_urls"; -const char kManagedNotificationsAllowedForUrls[] = - "profile.managed_notifications_allowed_for_urls"; -const char kManagedNotificationsBlockedForUrls[] = - "profile.managed_notifications_blocked_for_urls"; -const char kManagedAutoSelectCertificateForUrls[] = - "profile.managed_auto_select_certificate_for_urls"; } // namespace prefs |