Chromium Code Reviews| Index: components/content_settings/core/test/content_settings_test_utils.cc |
| diff --git a/components/content_settings/core/test/content_settings_test_utils.cc b/components/content_settings/core/test/content_settings_test_utils.cc |
| index 87207195f02851e5e1be9073e4bb820b42c65eb3..191e28e5faab05e771d410d77df97c97944a5e68 100644 |
| --- a/components/content_settings/core/test/content_settings_test_utils.cc |
| +++ b/components/content_settings/core/test/content_settings_test_utils.cc |
| @@ -4,7 +4,9 @@ |
| #include "components/content_settings/core/test/content_settings_test_utils.h" |
| +#include "components/content_settings/core/browser/content_settings_pref_provider.h" |
| #include "components/content_settings/core/browser/host_content_settings_map.h" |
| +#include "components/content_settings/core/common/content_settings_pattern.h" |
| #include "components/content_settings/core/common/content_settings_types.h" |
| namespace content_settings { |
| @@ -48,4 +50,16 @@ scoped_ptr<base::Value> TestUtils::GetContentSettingValueAndPatterns( |
| secondary_pattern); |
| } |
| +// static |
| +bool TestUtils::AddUserException(const std::string& pattern_string, |
|
raymes
2016/04/12 04:52:47
Could you instead just call HostContentSettingsMap
Bernhard Bauer
2016/04/12 09:30:05
+1 (That's what I meant in my earlier comments).
huangs
2016/04/12 14:19:14
But it looks like
SetContentSettingCustomScope()
huangs
2016/04/13 17:36:18
Anyway, if that's the convention then I'll use it.
Bernhard Bauer
2016/04/19 15:20:08
No, this was written to not treat the pref provide
|
| + ContentSettingsType content_type, |
| + ContentSetting setting, |
| + HostContentSettingsMap* settings_map) { |
| + ContentSettingsPattern pattern = |
| + ContentSettingsPattern::FromString(pattern_string); |
| + base::Value* value = new base::FundamentalValue(setting); |
| + return settings_map->GetPrefProvider()->SetWebsiteSetting( |
| + pattern, pattern, content_type, std::string(), value); |
| +} |
| + |
| } // namespace content_settings |