OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/content_settings/host_content_settings_map.h" | 5 #include "chrome/browser/content_settings/host_content_settings_map.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
203 false); | 203 false); |
204 } | 204 } |
205 } | 205 } |
206 | 206 |
207 void HostContentSettingsMap::SetDefaultContentSetting( | 207 void HostContentSettingsMap::SetDefaultContentSetting( |
208 ContentSettingsType content_type, | 208 ContentSettingsType content_type, |
209 ContentSetting setting) { | 209 ContentSetting setting) { |
210 DCHECK_NE(content_type, CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE); | 210 DCHECK_NE(content_type, CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE); |
211 DCHECK(IsSettingAllowedForType(setting, content_type)); | 211 DCHECK(IsSettingAllowedForType(setting, content_type)); |
212 | 212 |
213 base::Value* value = Value::CreateIntegerValue(setting); | 213 base::Value* value = NULL; |
214 if (!content_settings_providers_[DEFAULT_PROVIDER]->SetWebsiteSetting( | 214 if (setting != CONTENT_SETTING_DEFAULT) |
215 ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), | 215 value = Value::CreateIntegerValue(setting); |
216 content_type, std::string(), value)) { | 216 SetWebsiteSetting( |
James Hawkins
2011/11/18 21:21:13
I don't understand why you got rid of the if check
markusheintz_
2011/11/18 21:28:17
Sorry for the confusion, but I'm not calling the S
| |
217 delete value; | 217 ContentSettingsPattern::Wildcard(), |
218 } | 218 ContentSettingsPattern::Wildcard(), |
219 content_type, | |
220 std::string(), | |
221 value); | |
219 } | 222 } |
220 | 223 |
221 void HostContentSettingsMap::SetWebsiteSetting( | 224 void HostContentSettingsMap::SetWebsiteSetting( |
222 const ContentSettingsPattern& primary_pattern, | 225 const ContentSettingsPattern& primary_pattern, |
223 const ContentSettingsPattern& secondary_pattern, | 226 const ContentSettingsPattern& secondary_pattern, |
224 ContentSettingsType content_type, | 227 ContentSettingsType content_type, |
225 const std::string& resource_identifier, | 228 const std::string& resource_identifier, |
226 base::Value* value) { | 229 base::Value* value) { |
227 DCHECK(IsValueAllowedForType(value, content_type)); | 230 DCHECK(IsValueAllowedForType(value, content_type)); |
228 DCHECK(content_settings::SupportsResourceIdentifier(content_type) || | 231 DCHECK(content_settings::SupportsResourceIdentifier(content_type) || |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
447 } | 450 } |
448 } | 451 } |
449 | 452 |
450 if (info) { | 453 if (info) { |
451 info->source = content_settings::SETTING_SOURCE_NONE; | 454 info->source = content_settings::SETTING_SOURCE_NONE; |
452 info->primary_pattern = ContentSettingsPattern(); | 455 info->primary_pattern = ContentSettingsPattern(); |
453 info->secondary_pattern = ContentSettingsPattern(); | 456 info->secondary_pattern = ContentSettingsPattern(); |
454 } | 457 } |
455 return NULL; | 458 return NULL; |
456 } | 459 } |
OLD | NEW |