OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "components/content_settings/core/test/content_settings_test_utils.h" | 5 #include "components/content_settings/core/test/content_settings_test_utils.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "components/content_settings/core/browser/host_content_settings_map.h" |
8 #include "base/values.h" | |
9 #include "components/content_settings/core/common/content_settings_types.h" | 8 #include "components/content_settings/core/common/content_settings_types.h" |
10 | 9 |
11 namespace content_settings { | 10 namespace content_settings { |
12 | 11 |
13 base::Value* GetContentSettingValue(const ProviderInterface* provider, | 12 // static |
14 const GURL& primary_url, | 13 base::Value* TestUtils::GetContentSettingValue( |
15 const GURL& secondary_url, | 14 const ProviderInterface* provider, |
16 ContentSettingsType content_type, | 15 const GURL& primary_url, |
17 const std::string& resource_identifier, | 16 const GURL& secondary_url, |
18 bool include_incognito) { | 17 ContentSettingsType content_type, |
19 return GetContentSettingValueAndPatterns(provider, primary_url, secondary_url, | 18 const std::string& resource_identifier, |
20 content_type, resource_identifier, | 19 bool include_incognito) { |
21 include_incognito, NULL, NULL); | 20 return HostContentSettingsMap::GetContentSettingValueAndPatterns( |
| 21 provider, primary_url, secondary_url, content_type, resource_identifier, |
| 22 include_incognito, NULL, NULL).release(); |
22 } | 23 } |
23 | 24 |
24 ContentSetting GetContentSetting(const ProviderInterface* provider, | 25 // static |
25 const GURL& primary_url, | 26 ContentSetting TestUtils::GetContentSetting( |
26 const GURL& secondary_url, | 27 const ProviderInterface* provider, |
27 ContentSettingsType content_type, | 28 const GURL& primary_url, |
28 const std::string& resource_identifier, | 29 const GURL& secondary_url, |
29 bool include_incognito) { | 30 ContentSettingsType content_type, |
| 31 const std::string& resource_identifier, |
| 32 bool include_incognito) { |
30 scoped_ptr<base::Value> value( | 33 scoped_ptr<base::Value> value( |
31 GetContentSettingValue(provider, primary_url, secondary_url, content_type, | 34 GetContentSettingValue(provider, primary_url, secondary_url, content_type, |
32 resource_identifier, include_incognito)); | 35 resource_identifier, include_incognito)); |
33 return ValueToContentSetting(value.get()); | 36 return ValueToContentSetting(value.get()); |
34 } | 37 } |
35 | 38 |
| 39 // static |
| 40 scoped_ptr<base::Value> TestUtils::GetContentSettingValueAndPatterns( |
| 41 content_settings::RuleIterator* rule_iterator, |
| 42 const GURL& primary_url, |
| 43 const GURL& secondary_url, |
| 44 ContentSettingsPattern* primary_pattern, |
| 45 ContentSettingsPattern* secondary_pattern) { |
| 46 return HostContentSettingsMap::GetContentSettingValueAndPatterns( |
| 47 rule_iterator, primary_url, secondary_url, primary_pattern, |
| 48 secondary_pattern); |
| 49 } |
| 50 |
36 } // namespace content_settings | 51 } // namespace content_settings |
OLD | NEW |