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 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_UTILS_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_UTILS_H_ |
6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_UTILS_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 namespace content_settings { | 22 namespace content_settings { |
23 | 23 |
24 class ProviderInterface; | 24 class ProviderInterface; |
25 class RuleIterator; | 25 class RuleIterator; |
26 | 26 |
27 typedef std::pair<ContentSettingsPattern, ContentSettingsPattern> PatternPair; | 27 typedef std::pair<ContentSettingsPattern, ContentSettingsPattern> PatternPair; |
28 | 28 |
29 std::string GetTypeName(ContentSettingsType type); | 29 std::string GetTypeName(ContentSettingsType type); |
30 | 30 |
31 // Maps CONTENT_SETTING_ASK for the CONTENT_SETTINGS_TYPE_PLUGINS to | |
32 // CONTENT_SETTING_BLOCK if click-to-play is not enabled. | |
33 ContentSetting ClickToPlayFixup(ContentSettingsType content_type, | |
34 ContentSetting setting); | |
35 | |
36 // Converts |Value| to |ContentSetting|. | 31 // Converts |Value| to |ContentSetting|. |
37 ContentSetting ValueToContentSetting(const base::Value* value); | 32 ContentSetting ValueToContentSetting(const base::Value* value); |
38 | 33 |
39 // Converts a |Value| to a |ContentSetting|. Returns true if |value| encodes | 34 // Converts a |Value| to a |ContentSetting|. Returns true if |value| encodes |
40 // a valid content setting, false otherwise. Note that |CONTENT_SETTING_DEFAULT| | 35 // a valid content setting, false otherwise. Note that |CONTENT_SETTING_DEFAULT| |
41 // is encoded as a NULL value, so it is not allowed as an integer value. | 36 // is encoded as a NULL value, so it is not allowed as an integer value. |
42 bool ParseContentSettingValue(const base::Value* value, | 37 bool ParseContentSettingValue(const base::Value* value, |
43 ContentSetting* setting); | 38 ContentSetting* setting); |
44 | 39 |
45 PatternPair ParsePatternString(const std::string& pattern_str); | 40 PatternPair ParsePatternString(const std::string& pattern_str); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 bool include_incognito); | 78 bool include_incognito); |
84 | 79 |
85 // Populates |rules| with content setting rules for content types that are | 80 // Populates |rules| with content setting rules for content types that are |
86 // handled by the renderer. | 81 // handled by the renderer. |
87 void GetRendererContentSettingRules(const HostContentSettingsMap* map, | 82 void GetRendererContentSettingRules(const HostContentSettingsMap* map, |
88 RendererContentSettingRules* rules); | 83 RendererContentSettingRules* rules); |
89 | 84 |
90 } // namespace content_settings | 85 } // namespace content_settings |
91 | 86 |
92 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_UTILS_H_ | 87 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_UTILS_H_ |
OLD | NEW |