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 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_UTILS_H_ | 5 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_UTILS_H_ |
6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_UTILS_H_ | 6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // is encoded as a NULL value, so it is not allowed as an integer value. | 70 // is encoded as a NULL value, so it is not allowed as an integer value. |
71 bool ParseContentSettingValue(const base::Value* value, | 71 bool ParseContentSettingValue(const base::Value* value, |
72 ContentSetting* setting); | 72 ContentSetting* setting); |
73 | 73 |
74 PatternPair ParsePatternString(const std::string& pattern_str); | 74 PatternPair ParsePatternString(const std::string& pattern_str); |
75 | 75 |
76 std::string CreatePatternString( | 76 std::string CreatePatternString( |
77 const ContentSettingsPattern& item_pattern, | 77 const ContentSettingsPattern& item_pattern, |
78 const ContentSettingsPattern& top_level_frame_pattern); | 78 const ContentSettingsPattern& top_level_frame_pattern); |
79 | 79 |
80 // Caller takes the ownership of the returned |base::Value*|. | |
81 base::Value* GetContentSettingValueAndPatterns( | |
82 RuleIterator* rule_iterator, | |
83 const GURL& primary_url, | |
84 const GURL& secondary_url, | |
85 ContentSettingsPattern* primary_pattern, | |
86 ContentSettingsPattern* secondary_pattern); | |
87 | |
88 // Returns a |base::Value*| representation of |setting| if |setting| is | 80 // Returns a |base::Value*| representation of |setting| if |setting| is |
89 // a valid content setting. Otherwise, returns a nullptr. | 81 // a valid content setting. Otherwise, returns a nullptr. |
90 scoped_ptr<base::Value> ContentSettingToValue(ContentSetting setting); | 82 scoped_ptr<base::Value> ContentSettingToValue(ContentSetting setting); |
91 | 83 |
92 base::Value* GetContentSettingValueAndPatterns( | |
93 const ProviderInterface* provider, | |
94 const GURL& primary_url, | |
95 const GURL& secondary_url, | |
96 ContentSettingsType content_type, | |
97 const std::string& resource_identifier, | |
98 bool include_incognito, | |
99 ContentSettingsPattern* primary_pattern, | |
100 ContentSettingsPattern* secondary_pattern); | |
101 | |
102 // Populates |rules| with content setting rules for content types that are | 84 // Populates |rules| with content setting rules for content types that are |
103 // handled by the renderer. | 85 // handled by the renderer. |
104 void GetRendererContentSettingRules(const HostContentSettingsMap* map, | 86 void GetRendererContentSettingRules(const HostContentSettingsMap* map, |
105 RendererContentSettingRules* rules); | 87 RendererContentSettingRules* rules); |
106 | 88 |
107 } // namespace content_settings | 89 } // namespace content_settings |
108 | 90 |
109 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_UTILS_H_ | 91 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_UTILS_H_ |
OLD | NEW |