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 10 matching lines...) Expand all Loading... |
21 class GURL; | 21 class GURL; |
22 class HostContentSettingsMap; | 22 class HostContentSettingsMap; |
23 | 23 |
24 namespace content_settings { | 24 namespace content_settings { |
25 | 25 |
26 class ProviderInterface; | 26 class ProviderInterface; |
27 class RuleIterator; | 27 class RuleIterator; |
28 | 28 |
29 typedef std::pair<ContentSettingsPattern, ContentSettingsPattern> PatternPair; | 29 typedef std::pair<ContentSettingsPattern, ContentSettingsPattern> PatternPair; |
30 | 30 |
31 // Deprecated, do not call this! | |
32 // Call WebsiteSettingsRegistry::GetInstance()->Get(type)->name() instead. | |
33 // TODO(raymes): Inline this function at it's callsites. | |
34 std::string GetTypeName(ContentSettingsType type); | |
35 | |
36 std::string ContentSettingToString(ContentSetting setting); | 31 std::string ContentSettingToString(ContentSetting setting); |
37 | 32 |
38 ContentSetting ContentSettingFromString(const std::string& name); | 33 ContentSetting ContentSettingFromString(const std::string& name); |
39 | 34 |
40 // Converts |Value| to |ContentSetting|. | 35 // Converts |Value| to |ContentSetting|. |
41 ContentSetting ValueToContentSetting(const base::Value* value); | 36 ContentSetting ValueToContentSetting(const base::Value* value); |
42 | 37 |
43 // Converts a |Value| to a |ContentSetting|. Returns true if |value| encodes | 38 // Converts a |Value| to a |ContentSetting|. Returns true if |value| encodes |
44 // a valid content setting, false otherwise. Note that |CONTENT_SETTING_DEFAULT| | 39 // a valid content setting, false otherwise. Note that |CONTENT_SETTING_DEFAULT| |
45 // is encoded as a NULL value, so it is not allowed as an integer value. | 40 // is encoded as a NULL value, so it is not allowed as an integer value. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 void GetRendererContentSettingRules(const HostContentSettingsMap* map, | 74 void GetRendererContentSettingRules(const HostContentSettingsMap* map, |
80 RendererContentSettingRules* rules); | 75 RendererContentSettingRules* rules); |
81 | 76 |
82 // Get the flags to use when registering the preference to store |content_type| | 77 // Get the flags to use when registering the preference to store |content_type| |
83 // settings. | 78 // settings. |
84 uint32 PrefRegistrationFlagsForType(ContentSettingsType content_type); | 79 uint32 PrefRegistrationFlagsForType(ContentSettingsType content_type); |
85 | 80 |
86 } // namespace content_settings | 81 } // namespace content_settings |
87 | 82 |
88 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_UTILS_H_ | 83 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_UTILS_H_ |
OLD | NEW |