Don't set a default Value for content settigns type AutoSelectCertificate

BUG=106149
TEST=DefaultProviderTest*

Review URL: http://codereview.chromium.org/8776044

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112680 0039d316-1c4b-4281-b951-d872f2087c98
parent c651e106
......@@ -55,7 +55,8 @@ namespace {
class DefaultRuleIterator : public RuleIterator {
public:
explicit DefaultRuleIterator(const base::Value* value) {
value_.reset(value->DeepCopy());
if (value)
value_.reset(value->DeepCopy());
}
bool HasNext() const {
......@@ -316,9 +317,11 @@ void DefaultProvider::ReadDefaultSettings(bool overwrite) {
void DefaultProvider::ForceDefaultsToBeExplicit() {
for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) {
ContentSettingsType type = ContentSettingsType(i);
if (!default_settings_[type].get())
if (!default_settings_[type].get() &&
kDefaultSettings[i] != CONTENT_SETTING_DEFAULT) {
default_settings_[type].reset(
Value::CreateIntegerValue(kDefaultSettings[i]));
}
}
}
......
......@@ -78,6 +78,15 @@ TEST_F(DefaultProviderTest, DefaultValues) {
CONTENT_SETTINGS_TYPE_GEOLOCATION,
std::string(),
false));
scoped_ptr<base::Value> value(
GetContentSettingValue(&provider_,
GURL("http://example.com/"),
GURL("http://example.com/"),
CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE,
std::string(),
false));
EXPECT_FALSE(value.get());
}
TEST_F(DefaultProviderTest, IgnoreNonDefaultSettings) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment