summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-02 08:13:36 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-02 08:13:36 +0000
commitcf703f8392428c9b66865ca805afeab4aa0b92b7 (patch)
tree86eac374e4737d4ea087f0df2979691d2303a02e
parenta2b7c7b35054f37b8bc33e99f7adaf394183f061 (diff)
downloadchromium_src-cf703f8392428c9b66865ca805afeab4aa0b92b7.zip
chromium_src-cf703f8392428c9b66865ca805afeab4aa0b92b7.tar.gz
chromium_src-cf703f8392428c9b66865ca805afeab4aa0b92b7.tar.bz2
Remove CanProvideDefaultSettings method from default content settings provider interface.
BUG=63656 TEST=unit_tests:*ContentSettings*.* Review URL: http://codereview.chromium.org/6250077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73435 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/content_settings/content_settings_provider.h4
-rw-r--r--chrome/browser/content_settings/content_settings_provider_unittest.cc2
-rw-r--r--chrome/browser/content_settings/host_content_settings_map.cc2
-rw-r--r--chrome/browser/content_settings/mock_content_settings_provider.cc5
-rw-r--r--chrome/browser/content_settings/mock_content_settings_provider.h1
-rw-r--r--chrome/browser/content_settings/policy_content_settings_provider.cc11
-rw-r--r--chrome/browser/content_settings/policy_content_settings_provider.h1
-rw-r--r--chrome/browser/content_settings/policy_content_settings_provider_unittest.cc6
-rw-r--r--chrome/browser/content_settings/pref_content_settings_provider.cc5
-rw-r--r--chrome/browser/content_settings/pref_content_settings_provider.h1
-rw-r--r--chrome/browser/content_settings/pref_content_settings_provider_unittest.cc2
11 files changed, 0 insertions, 40 deletions
diff --git a/chrome/browser/content_settings/content_settings_provider.h b/chrome/browser/content_settings/content_settings_provider.h
index d58da29..19dae00 100644
--- a/chrome/browser/content_settings/content_settings_provider.h
+++ b/chrome/browser/content_settings/content_settings_provider.h
@@ -22,10 +22,6 @@ class DefaultProviderInterface {
public:
virtual ~DefaultProviderInterface() {}
- // True if this provider can provide a default setting for the |content_type|.
- virtual bool CanProvideDefaultSetting(
- ContentSettingsType content_type) const = 0;
-
// Returns the default content setting this provider has for the given
// |content_type|, or CONTENT_SETTING_DEFAULT if nothing be provided for this
// type.
diff --git a/chrome/browser/content_settings/content_settings_provider_unittest.cc b/chrome/browser/content_settings/content_settings_provider_unittest.cc
index 42a2242..4a0b992 100644
--- a/chrome/browser/content_settings/content_settings_provider_unittest.cc
+++ b/chrome/browser/content_settings/content_settings_provider_unittest.cc
@@ -13,8 +13,6 @@ TEST(ContentSettingsProviderTest, Mock) {
CONTENT_SETTING_ALLOW,
false,
true);
- EXPECT_TRUE(provider.CanProvideDefaultSetting(CONTENT_SETTINGS_TYPE_COOKIES));
- EXPECT_FALSE(provider.CanProvideDefaultSetting(CONTENT_SETTINGS_TYPE_POPUPS));
EXPECT_EQ(CONTENT_SETTING_ALLOW,
provider.ProvideDefaultSetting(CONTENT_SETTINGS_TYPE_COOKIES));
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc
index af91a66..6bf0759 100644
--- a/chrome/browser/content_settings/host_content_settings_map.cc
+++ b/chrome/browser/content_settings/host_content_settings_map.cc
@@ -183,8 +183,6 @@ ContentSetting HostContentSettingsMap::GetDefaultContentSetting(
for (const_provider_iterator provider =
default_content_settings_providers_.begin();
provider != default_content_settings_providers_.end(); ++provider) {
- if (!(*provider)->CanProvideDefaultSetting(content_type))
- continue;
ContentSetting provided_setting =
(*provider)->ProvideDefaultSetting(content_type);
if (provided_setting != CONTENT_SETTING_DEFAULT)
diff --git a/chrome/browser/content_settings/mock_content_settings_provider.cc b/chrome/browser/content_settings/mock_content_settings_provider.cc
index b4f12e0..ac5231b 100644
--- a/chrome/browser/content_settings/mock_content_settings_provider.cc
+++ b/chrome/browser/content_settings/mock_content_settings_provider.cc
@@ -20,11 +20,6 @@ MockContentSettingsProvider::MockContentSettingsProvider(
MockContentSettingsProvider::~MockContentSettingsProvider() {
}
-bool MockContentSettingsProvider::CanProvideDefaultSetting(
- ContentSettingsType content_type) const {
- return content_type == content_type_;
-}
-
ContentSetting MockContentSettingsProvider::ProvideDefaultSetting(
ContentSettingsType content_type) const {
return content_type == content_type_ ? setting_ : CONTENT_SETTING_DEFAULT;
diff --git a/chrome/browser/content_settings/mock_content_settings_provider.h b/chrome/browser/content_settings/mock_content_settings_provider.h
index 39d69b0..49fc448 100644
--- a/chrome/browser/content_settings/mock_content_settings_provider.h
+++ b/chrome/browser/content_settings/mock_content_settings_provider.h
@@ -23,7 +23,6 @@ class MockContentSettingsProvider : public DefaultProviderInterface,
virtual ~MockContentSettingsProvider();
// DefaultProviderInterface implementation.
- virtual bool CanProvideDefaultSetting(ContentSettingsType content_type) const;
virtual ContentSetting ProvideDefaultSetting(
ContentSettingsType content_type) const;
virtual void UpdateDefaultSetting(ContentSettingsType content_type,
diff --git a/chrome/browser/content_settings/policy_content_settings_provider.cc b/chrome/browser/content_settings/policy_content_settings_provider.cc
index ed2948a..fab9d54 100644
--- a/chrome/browser/content_settings/policy_content_settings_provider.cc
+++ b/chrome/browser/content_settings/policy_content_settings_provider.cc
@@ -71,17 +71,6 @@ PolicyDefaultProvider::~PolicyDefaultProvider() {
UnregisterObservers();
}
-bool PolicyDefaultProvider::CanProvideDefaultSetting(
- ContentSettingsType content_type) const {
- base::AutoLock lock(lock_);
- if (managed_default_content_settings_.settings[content_type] !=
- CONTENT_SETTING_DEFAULT) {
- return true;
- } else {
- return false;
- }
-}
-
ContentSetting PolicyDefaultProvider::ProvideDefaultSetting(
ContentSettingsType content_type) const {
base::AutoLock auto_lock(lock_);
diff --git a/chrome/browser/content_settings/policy_content_settings_provider.h b/chrome/browser/content_settings/policy_content_settings_provider.h
index 97aa529..b63e19b 100644
--- a/chrome/browser/content_settings/policy_content_settings_provider.h
+++ b/chrome/browser/content_settings/policy_content_settings_provider.h
@@ -29,7 +29,6 @@ class PolicyDefaultProvider : public DefaultProviderInterface,
virtual ~PolicyDefaultProvider();
// DefaultContentSettingsProvider implementation.
- virtual bool CanProvideDefaultSetting(ContentSettingsType content_type) const;
virtual ContentSetting ProvideDefaultSetting(
ContentSettingsType content_type) const;
virtual void UpdateDefaultSetting(ContentSettingsType content_type,
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 62782e2..807689e 100644
--- a/chrome/browser/content_settings/policy_content_settings_provider_unittest.cc
+++ b/chrome/browser/content_settings/policy_content_settings_provider_unittest.cc
@@ -33,16 +33,12 @@ TEST_F(PolicyDefaultProviderTest, DefaultValues) {
// By default, policies should be off.
ASSERT_FALSE(
- provider.CanProvideDefaultSetting(CONTENT_SETTINGS_TYPE_COOKIES));
- ASSERT_FALSE(
provider.DefaultSettingIsManaged(CONTENT_SETTINGS_TYPE_COOKIES));
// Set managed-default-content-setting through the coresponding preferences.
prefs->SetManagedPref(prefs::kManagedDefaultCookiesSetting,
Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
ASSERT_TRUE(
- provider.CanProvideDefaultSetting(CONTENT_SETTINGS_TYPE_COOKIES));
- ASSERT_TRUE(
provider.DefaultSettingIsManaged(CONTENT_SETTINGS_TYPE_COOKIES));
ASSERT_EQ(CONTENT_SETTING_BLOCK,
provider.ProvideDefaultSetting(CONTENT_SETTINGS_TYPE_COOKIES));
@@ -50,8 +46,6 @@ TEST_F(PolicyDefaultProviderTest, DefaultValues) {
// Remove managed-default-content-settings-preferences.
prefs->RemoveManagedPref(prefs::kManagedDefaultCookiesSetting);
ASSERT_FALSE(
- provider.CanProvideDefaultSetting(CONTENT_SETTINGS_TYPE_COOKIES));
- ASSERT_FALSE(
provider.DefaultSettingIsManaged(CONTENT_SETTINGS_TYPE_COOKIES));
}
diff --git a/chrome/browser/content_settings/pref_content_settings_provider.cc b/chrome/browser/content_settings/pref_content_settings_provider.cc
index 13e8b54..a7cf5e0 100644
--- a/chrome/browser/content_settings/pref_content_settings_provider.cc
+++ b/chrome/browser/content_settings/pref_content_settings_provider.cc
@@ -82,11 +82,6 @@ PrefDefaultProvider::~PrefDefaultProvider() {
UnregisterObservers();
}
-bool PrefDefaultProvider::CanProvideDefaultSetting(
- ContentSettingsType content_type) const {
- return true;
-}
-
ContentSetting PrefDefaultProvider::ProvideDefaultSetting(
ContentSettingsType content_type) const {
base::AutoLock lock(lock_);
diff --git a/chrome/browser/content_settings/pref_content_settings_provider.h b/chrome/browser/content_settings/pref_content_settings_provider.h
index 7d06746..8ed966424 100644
--- a/chrome/browser/content_settings/pref_content_settings_provider.h
+++ b/chrome/browser/content_settings/pref_content_settings_provider.h
@@ -29,7 +29,6 @@ class PrefDefaultProvider : public DefaultProviderInterface,
virtual ~PrefDefaultProvider();
// DefaultContentSettingsProvider implementation.
- virtual bool CanProvideDefaultSetting(ContentSettingsType content_type) const;
virtual ContentSetting ProvideDefaultSetting(
ContentSettingsType content_type) const;
virtual void UpdateDefaultSetting(ContentSettingsType content_type,
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 f628dd1..b27a05b 100644
--- a/chrome/browser/content_settings/pref_content_settings_provider_unittest.cc
+++ b/chrome/browser/content_settings/pref_content_settings_provider_unittest.cc
@@ -30,8 +30,6 @@ TEST_F(PrefDefaultProviderTest, DefaultValues) {
TestingProfile profile;
content_settings::PrefDefaultProvider provider(&profile);
- ASSERT_TRUE(
- provider.CanProvideDefaultSetting(CONTENT_SETTINGS_TYPE_COOKIES));
ASSERT_FALSE(
provider.DefaultSettingIsManaged(CONTENT_SETTINGS_TYPE_COOKIES));