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 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "chrome/browser/content_settings/content_settings_pattern.h" | |
14 #include "chrome/common/content_settings.h" | 13 #include "chrome/common/content_settings.h" |
| 14 #include "chrome/common/content_settings_pattern.h" |
15 #include "chrome/common/content_settings_types.h" | 15 #include "chrome/common/content_settings_types.h" |
16 | 16 |
17 namespace content_settings { | 17 namespace content_settings { |
18 | 18 |
19 typedef std::pair<ContentSettingsPattern, ContentSettingsPattern> PatternPair; | 19 typedef std::pair<ContentSettingsPattern, ContentSettingsPattern> PatternPair; |
20 | 20 |
21 // Returns true if the |content_type| requires a resource identifier. | 21 // Returns true if the |content_type| requires a resource identifier. |
22 bool RequiresResourceIdentifier(ContentSettingsType content_type); | 22 bool RequiresResourceIdentifier(ContentSettingsType content_type); |
23 | 23 |
24 // Maps CONTENT_SETTING_ASK for the CONTENT_SETTINGS_TYPE_PLUGINS to | 24 // Maps CONTENT_SETTING_ASK for the CONTENT_SETTINGS_TYPE_PLUGINS to |
25 // CONTENT_SETTING_BLOCK if click-to-play is not enabled. | 25 // CONTENT_SETTING_BLOCK if click-to-play is not enabled. |
26 ContentSetting ClickToPlayFixup(ContentSettingsType content_type, | 26 ContentSetting ClickToPlayFixup(ContentSettingsType content_type, |
27 ContentSetting setting); | 27 ContentSetting setting); |
28 | 28 |
29 // Converts |Value| to |ContentSetting|. | 29 // Converts |Value| to |ContentSetting|. |
30 ContentSetting ValueToContentSetting(Value* value); | 30 ContentSetting ValueToContentSetting(Value* value); |
31 | 31 |
32 PatternPair ParsePatternString(const std::string& pattern_str); | 32 PatternPair ParsePatternString(const std::string& pattern_str); |
33 | 33 |
34 std::string CreatePatternString( | 34 std::string CreatePatternString( |
35 const ContentSettingsPattern& item_pattern, | 35 const ContentSettingsPattern& item_pattern, |
36 const ContentSettingsPattern& top_level_frame_pattern); | 36 const ContentSettingsPattern& top_level_frame_pattern); |
37 | 37 |
38 } // namespace content_settings | 38 } // namespace content_settings |
39 | 39 |
40 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_UTILS_H_ | 40 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_UTILS_H_ |
OLD | NEW |