Chromium Code Reviews| Index: chrome/browser/content_settings/policy_content_settings_provider.cc |
| diff --git a/chrome/browser/content_settings/policy_content_settings_provider.cc b/chrome/browser/content_settings/policy_content_settings_provider.cc |
| index d271e74658f46a1ac6d9b659cdbcbf67b9fba6ee..f3bd824a5e3317b04c1410e930a93f1e9eb7e069 100644 |
| --- a/chrome/browser/content_settings/policy_content_settings_provider.cc |
| +++ b/chrome/browser/content_settings/policy_content_settings_provider.cc |
| @@ -38,9 +38,12 @@ const char* kPrefToManageType[CONTENT_SETTINGS_NUM_TYPES] = { |
| } // namespace |
| -PolicyContentSettingsProvider::PolicyContentSettingsProvider(Profile* profile) |
| - : profile_(profile), |
| - is_off_the_record_(profile_->IsOffTheRecord()) { |
| +namespace content_settings { |
| + |
| +PolicyDefaultContentSettingsProvider::PolicyDefaultContentSettingsProvider( |
| + Profile* profile) |
| + : profile_(profile), |
|
Bernhard Bauer
2011/01/27 09:54:26
Indent only four spaces in total here as well.
markusheintz_
2011/01/27 10:24:37
Done.
|
| + is_off_the_record_(profile_->IsOffTheRecord()) { |
| PrefService* prefs = profile->GetPrefs(); |
| // Read global defaults. |
| @@ -65,11 +68,11 @@ PolicyContentSettingsProvider::PolicyContentSettingsProvider(Profile* profile) |
| Source<Profile>(profile_)); |
| } |
| -PolicyContentSettingsProvider::~PolicyContentSettingsProvider() { |
| +PolicyDefaultContentSettingsProvider::~PolicyDefaultContentSettingsProvider() { |
| UnregisterObservers(); |
| } |
| -bool PolicyContentSettingsProvider::CanProvideDefaultSetting( |
| +bool PolicyDefaultContentSettingsProvider::CanProvideDefaultSetting( |
| ContentSettingsType content_type) const { |
| base::AutoLock lock(lock_); |
| if (managed_default_content_settings_.settings[content_type] != |
| @@ -80,18 +83,18 @@ bool PolicyContentSettingsProvider::CanProvideDefaultSetting( |
| } |
| } |
| -ContentSetting PolicyContentSettingsProvider::ProvideDefaultSetting( |
| +ContentSetting PolicyDefaultContentSettingsProvider::ProvideDefaultSetting( |
| ContentSettingsType content_type) const { |
| base::AutoLock auto_lock(lock_); |
| return managed_default_content_settings_.settings[content_type]; |
| } |
| -void PolicyContentSettingsProvider::UpdateDefaultSetting( |
| +void PolicyDefaultContentSettingsProvider::UpdateDefaultSetting( |
| ContentSettingsType content_type, |
| ContentSetting setting) { |
| } |
| -bool PolicyContentSettingsProvider::DefaultSettingIsManaged( |
| +bool PolicyDefaultContentSettingsProvider::DefaultSettingIsManaged( |
| ContentSettingsType content_type) const { |
| base::AutoLock lock(lock_); |
| if (managed_default_content_settings_.settings[content_type] != |
| @@ -102,10 +105,10 @@ bool PolicyContentSettingsProvider::DefaultSettingIsManaged( |
| } |
| } |
| -void PolicyContentSettingsProvider::ResetToDefaults() { |
| +void PolicyDefaultContentSettingsProvider::ResetToDefaults() { |
| } |
| -void PolicyContentSettingsProvider::Observe(NotificationType type, |
| +void PolicyDefaultContentSettingsProvider::Observe(NotificationType type, |
| const NotificationSource& source, |
| const NotificationDetails& details) { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| @@ -140,7 +143,7 @@ void PolicyContentSettingsProvider::Observe(NotificationType type, |
| } |
| } |
| -void PolicyContentSettingsProvider::UnregisterObservers() { |
| +void PolicyDefaultContentSettingsProvider::UnregisterObservers() { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| if (!profile_) |
| return; |
| @@ -151,7 +154,7 @@ void PolicyContentSettingsProvider::UnregisterObservers() { |
| } |
| -void PolicyContentSettingsProvider::NotifyObservers( |
| +void PolicyDefaultContentSettingsProvider::NotifyObservers( |
| const ContentSettingsDetails& details) { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| if (profile_ == NULL) |
| @@ -162,7 +165,7 @@ void PolicyContentSettingsProvider::NotifyObservers( |
| Details<const ContentSettingsDetails>(&details)); |
| } |
| -void PolicyContentSettingsProvider::ReadManagedDefaultSettings() { |
| +void PolicyDefaultContentSettingsProvider::ReadManagedDefaultSettings() { |
| for (size_t type = 0; type < arraysize(kPrefToManageType); ++type) { |
| if (kPrefToManageType[type] == NULL) { |
| // TODO(markusheintz): Handle Geolocation and notification separately. |
| @@ -172,14 +175,14 @@ void PolicyContentSettingsProvider::ReadManagedDefaultSettings() { |
| } |
| } |
| -void PolicyContentSettingsProvider::UpdateManagedDefaultSetting( |
| +void PolicyDefaultContentSettingsProvider::UpdateManagedDefaultSetting( |
| ContentSettingsType type) { |
| // If a pref to manage a default-content-setting was not set (NOTICE: |
| // "HasPrefPath" returns false if no value was set for a registered pref) then |
| // the default value of the preference is used. The default value of a |
| - // preference to manage a default-content-settings is |
| - // CONTENT_SETTING_DEFAULT. This indicates that no managed value is set. If a |
| - // pref was set, than it MUST be managed. |
| + // preference to manage a default-content-settings is CONTENT_SETTING_DEFAULT. |
| + // This indicates that no managed value is set. If a pref was set, than it |
| + // MUST be managed. |
| PrefService* prefs = profile_->GetPrefs(); |
| DCHECK(!prefs->HasPrefPath(kPrefToManageType[type]) || |
| prefs->IsManagedPreference(kPrefToManageType[type])); |
| @@ -189,7 +192,8 @@ void PolicyContentSettingsProvider::UpdateManagedDefaultSetting( |
| } |
| // static |
| -void PolicyContentSettingsProvider::RegisterUserPrefs(PrefService* prefs) { |
| +void PolicyDefaultContentSettingsProvider::RegisterUserPrefs( |
| + PrefService* prefs) { |
| // Preferences for default content setting policies. A policy is not set of |
| // the corresponding preferences below is set to CONTENT_SETTING_DEFAULT. |
| prefs->RegisterIntegerPref(prefs::kManagedDefaultCookiesSetting, |
| @@ -203,3 +207,5 @@ void PolicyContentSettingsProvider::RegisterUserPrefs(PrefService* prefs) { |
| prefs->RegisterIntegerPref(prefs::kManagedDefaultPopupsSetting, |
| CONTENT_SETTING_DEFAULT); |
| } |
| + |
| +} // namespace content_settings |