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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 // These constants are copied from extensions/common/extension_constants.h and | 52 // These constants are copied from extensions/common/extension_constants.h and |
53 // content/public/common/url_constants.h to avoid complicated dependencies. | 53 // content/public/common/url_constants.h to avoid complicated dependencies. |
54 // TODO(vabr): Get these constants through the ContentSettingsClient. | 54 // TODO(vabr): Get these constants through the ContentSettingsClient. |
55 const char kChromeDevToolsScheme[] = "chrome-devtools"; | 55 const char kChromeDevToolsScheme[] = "chrome-devtools"; |
56 const char kChromeUIScheme[] = "chrome"; | 56 const char kChromeUIScheme[] = "chrome"; |
57 | 57 |
58 #if defined(ENABLE_EXTENSIONS) | 58 #if defined(ENABLE_EXTENSIONS) |
59 const char kExtensionScheme[] = "chrome-extension"; | 59 const char kExtensionScheme[] = "chrome-extension"; |
60 #endif | 60 #endif |
61 | 61 |
62 std::string ContentSettingToString(ContentSetting setting); | 62 // Converts a ContentSetting to the corresponding content setting string. |
63 // Returns true if |setting| specifies a valid content setting string, false | |
64 // otherwise. | |
65 bool ContentSettingToString(ContentSetting setting, | |
Bernhard Bauer
2015/10/07 11:38:21
I think for this method returning the old signatur
Deepak
2015/10/07 13:54:43
Done.
| |
66 std::string* setting_string); | |
63 | 67 |
64 ContentSetting ContentSettingFromString(const std::string& name); | 68 // Converts a content setting string to the corresponding ContentSetting. |
69 // Returns true if |name| specifies a valid content setting, false otherwise. | |
70 bool ContentSettingFromString(const std::string& name, ContentSetting* setting); | |
65 | 71 |
66 // Converts |Value| to |ContentSetting|. | 72 // Converts |Value| to |ContentSetting|. |
67 ContentSetting ValueToContentSetting(const base::Value* value); | 73 ContentSetting ValueToContentSetting(const base::Value* value); |
68 | 74 |
69 // Converts a |Value| to a |ContentSetting|. Returns true if |value| encodes | 75 // Converts a |Value| to a |ContentSetting|. Returns true if |value| encodes |
70 // a valid content setting, false otherwise. Note that |CONTENT_SETTING_DEFAULT| | 76 // a valid content setting, false otherwise. Note that |CONTENT_SETTING_DEFAULT| |
71 // is encoded as a NULL value, so it is not allowed as an integer value. | 77 // is encoded as a NULL value, so it is not allowed as an integer value. |
72 bool ParseContentSettingValue(const base::Value* value, | 78 bool ParseContentSettingValue(const base::Value* value, |
73 ContentSetting* setting); | 79 ContentSetting* setting); |
74 | 80 |
(...skipping 26 matching lines...) Expand all Loading... | |
101 ContentSettingsPattern* secondary_pattern); | 107 ContentSettingsPattern* secondary_pattern); |
102 | 108 |
103 // Populates |rules| with content setting rules for content types that are | 109 // Populates |rules| with content setting rules for content types that are |
104 // handled by the renderer. | 110 // handled by the renderer. |
105 void GetRendererContentSettingRules(const HostContentSettingsMap* map, | 111 void GetRendererContentSettingRules(const HostContentSettingsMap* map, |
106 RendererContentSettingRules* rules); | 112 RendererContentSettingRules* rules); |
107 | 113 |
108 } // namespace content_settings | 114 } // namespace content_settings |
109 | 115 |
110 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_UTILS_H_ | 116 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_UTILS_H_ |
OLD | NEW |