diff options
author | markusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-31 12:54:45 +0000 |
---|---|---|
committer | markusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-31 12:54:45 +0000 |
commit | b24c4fb25d330bcd53fb459bbb5aadebcb14d59b (patch) | |
tree | af4cd2bc7fcf796e130c0e9f74f5740c8d927722 /chrome/browser/content_settings | |
parent | e2bcd1270373684e93d813366a392b14fa857ebe (diff) | |
download | chromium_src-b24c4fb25d330bcd53fb459bbb5aadebcb14d59b.zip chromium_src-b24c4fb25d330bcd53fb459bbb5aadebcb14d59b.tar.gz chromium_src-b24c4fb25d330bcd53fb459bbb5aadebcb14d59b.tar.bz2 |
Rename {Pref,Policy}ContentSettingsProvider to {Pref,Policy}DefaultContentSettingsProvider
BUG=63656
TEST=pref_content_settings_provider_unittest.cc,
policy_content_settings_provider_unittest.cc
Review URL: http://codereview.chromium.org/6274016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73140 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/content_settings')
12 files changed, 110 insertions, 69 deletions
diff --git a/chrome/browser/content_settings/content_settings_provider.h b/chrome/browser/content_settings/content_settings_provider.h index e791ead..b330db8 100644 --- a/chrome/browser/content_settings/content_settings_provider.h +++ b/chrome/browser/content_settings/content_settings_provider.h @@ -10,9 +10,11 @@ #include "chrome/common/content_settings.h" -class DefaultContentSettingsProvider { +namespace content_settings { + +class DefaultProviderInterface { public: - virtual ~DefaultContentSettingsProvider() {} + virtual ~DefaultProviderInterface() {} // True if this provider can provide a default setting for the |content_type|. virtual bool CanProvideDefaultSetting( @@ -39,4 +41,6 @@ class DefaultContentSettingsProvider { ContentSettingsType content_type) const = 0; }; +} // namespace content_settings + #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ diff --git a/chrome/browser/content_settings/content_settings_provider_unittest.cc b/chrome/browser/content_settings/content_settings_provider_unittest.cc index bb625ef..42a2242 100644 --- a/chrome/browser/content_settings/content_settings_provider_unittest.cc +++ b/chrome/browser/content_settings/content_settings_provider_unittest.cc @@ -6,6 +6,8 @@ #include "chrome/browser/content_settings/mock_content_settings_provider.h" +namespace content_settings { + TEST(ContentSettingsProviderTest, Mock) { MockContentSettingsProvider provider(CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_ALLOW, @@ -24,3 +26,5 @@ TEST(ContentSettingsProviderTest, Mock) { EXPECT_EQ(CONTENT_SETTING_BLOCK, provider.ProvideDefaultSetting(CONTENT_SETTINGS_TYPE_COOKIES)); } + +} // namespace content_settings diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc index 241ca3e..af91a66 100644 --- a/chrome/browser/content_settings/host_content_settings_map.cc +++ b/chrome/browser/content_settings/host_content_settings_map.cc @@ -88,7 +88,7 @@ ContentSetting ClickToPlayFixup(ContentSettingsType content_type, return setting; } -typedef linked_ptr<DefaultContentSettingsProvider> +typedef linked_ptr<content_settings::DefaultProviderInterface> DefaultContentSettingsProviderPtr; typedef std::vector<DefaultContentSettingsProviderPtr>::iterator provider_iterator; @@ -114,10 +114,10 @@ HostContentSettingsMap::HostContentSettingsMap(Profile* profile) // providers further up. default_content_settings_providers_.push_back( DefaultContentSettingsProviderPtr( - new PrefContentSettingsProvider(profile))); + new content_settings::PrefDefaultProvider(profile))); default_content_settings_providers_.push_back( DefaultContentSettingsProviderPtr( - new PolicyContentSettingsProvider(profile))); + new content_settings::PolicyDefaultProvider(profile))); PrefService* prefs = profile_->GetPrefs(); @@ -171,6 +171,10 @@ void HostContentSettingsMap::RegisterUserPrefs(PrefService* prefs) { net::StaticCookiePolicy::ALLOW_ALL_COOKIES); prefs->RegisterListPref(prefs::kPopupWhitelistedHosts); prefs->RegisterDictionaryPref(prefs::kPerHostContentSettings); + + // Register the prefs for the content settings providers. + content_settings::PrefDefaultProvider::RegisterUserPrefs(prefs); + content_settings::PolicyDefaultProvider::RegisterUserPrefs(prefs); } ContentSetting HostContentSettingsMap::GetDefaultContentSetting( diff --git a/chrome/browser/content_settings/host_content_settings_map.h b/chrome/browser/content_settings/host_content_settings_map.h index e43309f..2cbbddd 100644 --- a/chrome/browser/content_settings/host_content_settings_map.h +++ b/chrome/browser/content_settings/host_content_settings_map.h @@ -25,8 +25,11 @@ #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +namespace content_settings { +class DefaultProviderInterface; +} // namespace content_settings + class ContentSettingsDetails; -class DefaultContentSettingsProvider; class DictionaryValue; class GURL; class PrefService; @@ -229,7 +232,7 @@ class HostContentSettingsMap bool updating_preferences_; // Content setting providers. - std::vector<linked_ptr<DefaultContentSettingsProvider> > + std::vector<linked_ptr<content_settings::DefaultProviderInterface> > default_content_settings_providers_; // Used around accesses to the following objects to guarantee thread safety. diff --git a/chrome/browser/content_settings/mock_content_settings_provider.cc b/chrome/browser/content_settings/mock_content_settings_provider.cc index d01df59..b4f12e0 100644 --- a/chrome/browser/content_settings/mock_content_settings_provider.cc +++ b/chrome/browser/content_settings/mock_content_settings_provider.cc @@ -4,6 +4,8 @@ #include "chrome/browser/content_settings/mock_content_settings_provider.h" +namespace content_settings { + MockContentSettingsProvider::MockContentSettingsProvider( ContentSettingsType content_type, ContentSetting setting, @@ -42,3 +44,5 @@ bool MockContentSettingsProvider::DefaultSettingIsManaged( void MockContentSettingsProvider::ResetToDefaults() { } + +} // namespace content_settings diff --git a/chrome/browser/content_settings/mock_content_settings_provider.h b/chrome/browser/content_settings/mock_content_settings_provider.h index 7c7439d..21f5436 100644 --- a/chrome/browser/content_settings/mock_content_settings_provider.h +++ b/chrome/browser/content_settings/mock_content_settings_provider.h @@ -9,7 +9,9 @@ #include "base/basictypes.h" #include "chrome/browser/content_settings/content_settings_provider.h" -class MockContentSettingsProvider : public DefaultContentSettingsProvider { +namespace content_settings { + +class MockContentSettingsProvider : public DefaultProviderInterface { public: // Create a content settings provider that provides a given setting for a // given type. @@ -37,4 +39,6 @@ class MockContentSettingsProvider : public DefaultContentSettingsProvider { DISALLOW_COPY_AND_ASSIGN(MockContentSettingsProvider); }; +} // namespace content_settings + #endif // CHROME_BROWSER_CONTENT_SETTINGS_MOCK_CONTENT_SETTINGS_PROVIDER_H_ diff --git a/chrome/browser/content_settings/policy_content_settings_provider.cc b/chrome/browser/content_settings/policy_content_settings_provider.cc index d271e74..ed2948a 100644 --- a/chrome/browser/content_settings/policy_content_settings_provider.cc +++ b/chrome/browser/content_settings/policy_content_settings_provider.cc @@ -38,7 +38,9 @@ const char* kPrefToManageType[CONTENT_SETTINGS_NUM_TYPES] = { } // namespace -PolicyContentSettingsProvider::PolicyContentSettingsProvider(Profile* profile) +namespace content_settings { + +PolicyDefaultProvider::PolicyDefaultProvider(Profile* profile) : profile_(profile), is_off_the_record_(profile_->IsOffTheRecord()) { PrefService* prefs = profile->GetPrefs(); @@ -65,11 +67,11 @@ PolicyContentSettingsProvider::PolicyContentSettingsProvider(Profile* profile) Source<Profile>(profile_)); } -PolicyContentSettingsProvider::~PolicyContentSettingsProvider() { +PolicyDefaultProvider::~PolicyDefaultProvider() { UnregisterObservers(); } -bool PolicyContentSettingsProvider::CanProvideDefaultSetting( +bool PolicyDefaultProvider::CanProvideDefaultSetting( ContentSettingsType content_type) const { base::AutoLock lock(lock_); if (managed_default_content_settings_.settings[content_type] != @@ -80,18 +82,18 @@ bool PolicyContentSettingsProvider::CanProvideDefaultSetting( } } -ContentSetting PolicyContentSettingsProvider::ProvideDefaultSetting( +ContentSetting PolicyDefaultProvider::ProvideDefaultSetting( ContentSettingsType content_type) const { base::AutoLock auto_lock(lock_); return managed_default_content_settings_.settings[content_type]; } -void PolicyContentSettingsProvider::UpdateDefaultSetting( +void PolicyDefaultProvider::UpdateDefaultSetting( ContentSettingsType content_type, ContentSetting setting) { } -bool PolicyContentSettingsProvider::DefaultSettingIsManaged( +bool PolicyDefaultProvider::DefaultSettingIsManaged( ContentSettingsType content_type) const { base::AutoLock lock(lock_); if (managed_default_content_settings_.settings[content_type] != @@ -102,12 +104,12 @@ bool PolicyContentSettingsProvider::DefaultSettingIsManaged( } } -void PolicyContentSettingsProvider::ResetToDefaults() { +void PolicyDefaultProvider::ResetToDefaults() { } -void PolicyContentSettingsProvider::Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details) { +void PolicyDefaultProvider::Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (type == NotificationType::PREF_CHANGED) { @@ -140,7 +142,7 @@ void PolicyContentSettingsProvider::Observe(NotificationType type, } } -void PolicyContentSettingsProvider::UnregisterObservers() { +void PolicyDefaultProvider::UnregisterObservers() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!profile_) return; @@ -151,7 +153,7 @@ void PolicyContentSettingsProvider::UnregisterObservers() { } -void PolicyContentSettingsProvider::NotifyObservers( +void PolicyDefaultProvider::NotifyObservers( const ContentSettingsDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (profile_ == NULL) @@ -162,7 +164,7 @@ void PolicyContentSettingsProvider::NotifyObservers( Details<const ContentSettingsDetails>(&details)); } -void PolicyContentSettingsProvider::ReadManagedDefaultSettings() { +void PolicyDefaultProvider::ReadManagedDefaultSettings() { for (size_t type = 0; type < arraysize(kPrefToManageType); ++type) { if (kPrefToManageType[type] == NULL) { // TODO(markusheintz): Handle Geolocation and notification separately. @@ -172,7 +174,7 @@ void PolicyContentSettingsProvider::ReadManagedDefaultSettings() { } } -void PolicyContentSettingsProvider::UpdateManagedDefaultSetting( +void PolicyDefaultProvider::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 @@ -189,7 +191,7 @@ void PolicyContentSettingsProvider::UpdateManagedDefaultSetting( } // static -void PolicyContentSettingsProvider::RegisterUserPrefs(PrefService* prefs) { +void PolicyDefaultProvider::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 +205,5 @@ void PolicyContentSettingsProvider::RegisterUserPrefs(PrefService* prefs) { prefs->RegisterIntegerPref(prefs::kManagedDefaultPopupsSetting, CONTENT_SETTING_DEFAULT); } + +} // namespace content_settings diff --git a/chrome/browser/content_settings/policy_content_settings_provider.h b/chrome/browser/content_settings/policy_content_settings_provider.h index 3aad043..97aa529 100644 --- a/chrome/browser/content_settings/policy_content_settings_provider.h +++ b/chrome/browser/content_settings/policy_content_settings_provider.h @@ -20,11 +20,13 @@ class DictionaryValue; class PrefService; class Profile; -class PolicyContentSettingsProvider : public DefaultContentSettingsProvider, - public NotificationObserver { +namespace content_settings { + +class PolicyDefaultProvider : public DefaultProviderInterface, + public NotificationObserver { public: - explicit PolicyContentSettingsProvider(Profile* profile); - virtual ~PolicyContentSettingsProvider(); + explicit PolicyDefaultProvider(Profile* profile); + virtual ~PolicyDefaultProvider(); // DefaultContentSettingsProvider implementation. virtual bool CanProvideDefaultSetting(ContentSettingsType content_type) const; @@ -72,7 +74,9 @@ class PolicyContentSettingsProvider : public DefaultContentSettingsProvider, PrefChangeRegistrar pref_change_registrar_; NotificationRegistrar notification_registrar_; - DISALLOW_COPY_AND_ASSIGN(PolicyContentSettingsProvider); + DISALLOW_COPY_AND_ASSIGN(PolicyDefaultProvider); }; +} // namespace content_settings + #endif // CHROME_BROWSER_CONTENT_SETTINGS_POLICY_CONTENT_SETTINGS_PROVIDER_H_ diff --git a/chrome/browser/content_settings/policy_content_settings_provider_unittest.cc b/chrome/browser/content_settings/policy_content_settings_provider_unittest.cc index 9c639ab..62782e2 100644 --- a/chrome/browser/content_settings/policy_content_settings_provider_unittest.cc +++ b/chrome/browser/content_settings/policy_content_settings_provider_unittest.cc @@ -13,11 +13,11 @@ #include "testing/gtest/include/gtest/gtest.h" -namespace { +namespace content_settings { -class PolicyContentSettingsProviderTest : public testing::Test { +class PolicyDefaultProviderTest : public testing::Test { public: - PolicyContentSettingsProviderTest() + PolicyDefaultProviderTest() : ui_thread_(BrowserThread::UI, &message_loop_) { } @@ -26,9 +26,9 @@ class PolicyContentSettingsProviderTest : public testing::Test { BrowserThread ui_thread_; }; -TEST_F(PolicyContentSettingsProviderTest, DefaultValues) { +TEST_F(PolicyDefaultProviderTest, DefaultValues) { TestingProfile profile; - PolicyContentSettingsProvider provider(&profile); + PolicyDefaultProvider provider(&profile); TestingPrefService* prefs = profile.GetTestingPrefService(); // By default, policies should be off. @@ -58,7 +58,7 @@ TEST_F(PolicyContentSettingsProviderTest, DefaultValues) { // When a default-content-setting is set to a managed setting a // CONTENT_SETTINGS_CHANGED notification should be fired. The same should happen // if the managed setting is removed. -TEST_F(PolicyContentSettingsProviderTest, ObserveManagedSettingsChange) { +TEST_F(PolicyDefaultProviderTest, ObserveManagedSettingsChange) { TestingProfile profile; StubSettingsObserver observer; // Make sure the content settings map exists. @@ -85,4 +85,4 @@ TEST_F(PolicyContentSettingsProviderTest, ObserveManagedSettingsChange) { EXPECT_EQ(2, observer.counter); } -} // namespace +} // namespace content_settings diff --git a/chrome/browser/content_settings/pref_content_settings_provider.cc b/chrome/browser/content_settings/pref_content_settings_provider.cc index 0afe1f9..13e8b54 100644 --- a/chrome/browser/content_settings/pref_content_settings_provider.cc +++ b/chrome/browser/content_settings/pref_content_settings_provider.cc @@ -4,6 +4,8 @@ #include "chrome/browser/content_settings/pref_content_settings_provider.h" +#include <string> + #include "base/command_line.h" #include "chrome/browser/browser_thread.h" #include "chrome/browser/content_settings/content_settings_details.h" @@ -57,7 +59,9 @@ ContentSetting ClickToPlayFixup(ContentSettingsType content_type, } // namespace -PrefContentSettingsProvider::PrefContentSettingsProvider(Profile* profile) +namespace content_settings { + +PrefDefaultProvider::PrefDefaultProvider(Profile* profile) : profile_(profile), is_off_the_record_(profile_->IsOffTheRecord()), updating_preferences_(false) { @@ -74,22 +78,22 @@ PrefContentSettingsProvider::PrefContentSettingsProvider(Profile* profile) Source<Profile>(profile_)); } -PrefContentSettingsProvider::~PrefContentSettingsProvider() { +PrefDefaultProvider::~PrefDefaultProvider() { UnregisterObservers(); } -bool PrefContentSettingsProvider::CanProvideDefaultSetting( +bool PrefDefaultProvider::CanProvideDefaultSetting( ContentSettingsType content_type) const { return true; } -ContentSetting PrefContentSettingsProvider::ProvideDefaultSetting( +ContentSetting PrefDefaultProvider::ProvideDefaultSetting( ContentSettingsType content_type) const { base::AutoLock lock(lock_); return default_content_settings_.settings[content_type]; } -void PrefContentSettingsProvider::UpdateDefaultSetting( +void PrefDefaultProvider::UpdateDefaultSetting( ContentSettingsType content_type, ContentSetting setting) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); @@ -131,12 +135,12 @@ void PrefContentSettingsProvider::UpdateDefaultSetting( ContentSettingsDetails(ContentSettingsPattern(), content_type, "")); } -bool PrefContentSettingsProvider::DefaultSettingIsManaged( +bool PrefDefaultProvider::DefaultSettingIsManaged( ContentSettingsType content_type) const { return false; } -void PrefContentSettingsProvider::ResetToDefaults() { +void PrefDefaultProvider::ResetToDefaults() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); base::AutoLock lock(lock_); default_content_settings_ = ContentSettings(); @@ -150,9 +154,9 @@ void PrefContentSettingsProvider::ResetToDefaults() { } } -void PrefContentSettingsProvider::Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details) { +void PrefDefaultProvider::Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (type == NotificationType::PREF_CHANGED) { @@ -180,7 +184,7 @@ void PrefContentSettingsProvider::Observe(NotificationType type, } } -void PrefContentSettingsProvider::UnregisterObservers() { +void PrefDefaultProvider::UnregisterObservers() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!profile_) return; @@ -190,7 +194,7 @@ void PrefContentSettingsProvider::UnregisterObservers() { profile_ = NULL; } -void PrefContentSettingsProvider::ReadDefaultSettings(bool overwrite) { +void PrefDefaultProvider::ReadDefaultSettings(bool overwrite) { PrefService* prefs = profile_->GetPrefs(); const DictionaryValue* default_settings_dictionary = prefs->GetDictionary(prefs::kDefaultContentSettings); @@ -208,7 +212,7 @@ void PrefContentSettingsProvider::ReadDefaultSettings(bool overwrite) { ForceDefaultsToBeExplicit(); } -void PrefContentSettingsProvider::ForceDefaultsToBeExplicit() { +void PrefDefaultProvider::ForceDefaultsToBeExplicit() { DCHECK_EQ(arraysize(kDefaultSettings), static_cast<size_t>(CONTENT_SETTINGS_NUM_TYPES)); @@ -218,7 +222,7 @@ void PrefContentSettingsProvider::ForceDefaultsToBeExplicit() { } } -void PrefContentSettingsProvider::GetSettingsFromDictionary( +void PrefDefaultProvider::GetSettingsFromDictionary( const DictionaryValue* dictionary, ContentSettings* settings) { for (DictionaryValue::key_iterator i(dictionary->begin_keys()); @@ -245,7 +249,7 @@ void PrefContentSettingsProvider::GetSettingsFromDictionary( settings->settings[CONTENT_SETTINGS_TYPE_PLUGINS]); } -void PrefContentSettingsProvider::NotifyObservers( +void PrefDefaultProvider::NotifyObservers( const ContentSettingsDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (profile_ == NULL) @@ -258,6 +262,8 @@ void PrefContentSettingsProvider::NotifyObservers( // static -void PrefContentSettingsProvider::RegisterUserPrefs(PrefService* prefs) { +void PrefDefaultProvider::RegisterUserPrefs(PrefService* prefs) { prefs->RegisterDictionaryPref(prefs::kDefaultContentSettings); } + +} // namespace content_settings diff --git a/chrome/browser/content_settings/pref_content_settings_provider.h b/chrome/browser/content_settings/pref_content_settings_provider.h index 445e90c..7d06746 100644 --- a/chrome/browser/content_settings/pref_content_settings_provider.h +++ b/chrome/browser/content_settings/pref_content_settings_provider.h @@ -20,11 +20,13 @@ class DictionaryValue; class PrefService; class Profile; -class PrefContentSettingsProvider : public DefaultContentSettingsProvider, - public NotificationObserver { +namespace content_settings { + +class PrefDefaultProvider : public DefaultProviderInterface, + public NotificationObserver { public: - explicit PrefContentSettingsProvider(Profile* profile); - virtual ~PrefContentSettingsProvider(); + explicit PrefDefaultProvider(Profile* profile); + virtual ~PrefDefaultProvider(); // DefaultContentSettingsProvider implementation. virtual bool CanProvideDefaultSetting(ContentSettingsType content_type) const; @@ -82,7 +84,9 @@ class PrefContentSettingsProvider : public DefaultContentSettingsProvider, // notifications from the preferences service that we triggered ourself. bool updating_preferences_; - DISALLOW_COPY_AND_ASSIGN(PrefContentSettingsProvider); + DISALLOW_COPY_AND_ASSIGN(PrefDefaultProvider); }; +} // namespace content_settings + #endif // CHROME_BROWSER_CONTENT_SETTINGS_PREF_CONTENT_SETTINGS_PROVIDER_H_ diff --git a/chrome/browser/content_settings/pref_content_settings_provider_unittest.cc b/chrome/browser/content_settings/pref_content_settings_provider_unittest.cc index f4289f3..f628dd1 100644 --- a/chrome/browser/content_settings/pref_content_settings_provider_unittest.cc +++ b/chrome/browser/content_settings/pref_content_settings_provider_unittest.cc @@ -13,11 +13,11 @@ #include "testing/gtest/include/gtest/gtest.h" -namespace { +namespace content_settings { -class PrefContentSettingsProviderTest : public testing::Test { +class PrefDefaultProviderTest : public testing::Test { public: - PrefContentSettingsProviderTest() + PrefDefaultProviderTest() : ui_thread_(BrowserThread::UI, &message_loop_) { } @@ -26,9 +26,9 @@ class PrefContentSettingsProviderTest : public testing::Test { BrowserThread ui_thread_; }; -TEST_F(PrefContentSettingsProviderTest, DefaultValues) { +TEST_F(PrefDefaultProviderTest, DefaultValues) { TestingProfile profile; - PrefContentSettingsProvider provider(&profile); + content_settings::PrefDefaultProvider provider(&profile); ASSERT_TRUE( provider.CanProvideDefaultSetting(CONTENT_SETTINGS_TYPE_COOKIES)); @@ -47,9 +47,9 @@ TEST_F(PrefContentSettingsProviderTest, DefaultValues) { provider.ProvideDefaultSetting(CONTENT_SETTINGS_TYPE_COOKIES)); } -TEST_F(PrefContentSettingsProviderTest, Observer) { +TEST_F(PrefDefaultProviderTest, Observer) { TestingProfile profile; - PrefContentSettingsProvider provider(&profile); + PrefDefaultProvider provider(&profile); StubSettingsObserver observer; provider.UpdateDefaultSetting( @@ -60,9 +60,9 @@ TEST_F(PrefContentSettingsProviderTest, Observer) { EXPECT_EQ(1, observer.counter); } -TEST_F(PrefContentSettingsProviderTest, ObserveDefaultPref) { +TEST_F(PrefDefaultProviderTest, ObserveDefaultPref) { TestingProfile profile; - PrefContentSettingsProvider provider(&profile); + PrefDefaultProvider provider(&profile); PrefService* prefs = profile.GetPrefs(); @@ -90,12 +90,12 @@ TEST_F(PrefContentSettingsProviderTest, ObserveDefaultPref) { provider.ProvideDefaultSetting(CONTENT_SETTINGS_TYPE_COOKIES)); } -TEST_F(PrefContentSettingsProviderTest, OffTheRecord) { +TEST_F(PrefDefaultProviderTest, OffTheRecord) { TestingProfile profile; - PrefContentSettingsProvider provider(&profile); + PrefDefaultProvider provider(&profile); profile.set_off_the_record(true); - PrefContentSettingsProvider otr_provider(&profile); + PrefDefaultProvider otr_provider(&profile); profile.set_off_the_record(false); EXPECT_EQ(CONTENT_SETTING_ALLOW, @@ -121,4 +121,4 @@ TEST_F(PrefContentSettingsProviderTest, OffTheRecord) { otr_provider.ProvideDefaultSetting(CONTENT_SETTINGS_TYPE_COOKIES)); } -} // namespace +} // namespace content_settings |