| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 IteratorType iterator_; | 49 IteratorType iterator_; |
| 50 }; | 50 }; |
| 51 | 51 |
| 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 | |
| 58 #if defined(ENABLE_EXTENSIONS) | |
| 59 const char kExtensionScheme[] = "chrome-extension"; | 57 const char kExtensionScheme[] = "chrome-extension"; |
| 60 #endif | |
| 61 | 58 |
| 62 std::string ContentSettingToString(ContentSetting setting); | 59 std::string ContentSettingToString(ContentSetting setting); |
| 63 | 60 |
| 64 // Converts a content setting string to the corresponding ContentSetting. | 61 // Converts a content setting string to the corresponding ContentSetting. |
| 65 // Returns true if |name| specifies a valid content setting, false otherwise. | 62 // Returns true if |name| specifies a valid content setting, false otherwise. |
| 66 bool ContentSettingFromString(const std::string& name, ContentSetting* setting); | 63 bool ContentSettingFromString(const std::string& name, ContentSetting* setting); |
| 67 | 64 |
| 68 // Converts |Value| to |ContentSetting|. | 65 // Converts |Value| to |ContentSetting|. |
| 69 ContentSetting ValueToContentSetting(const base::Value* value); | 66 ContentSetting ValueToContentSetting(const base::Value* value); |
| 70 | 67 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 ContentSettingsPattern* secondary_pattern); | 100 ContentSettingsPattern* secondary_pattern); |
| 104 | 101 |
| 105 // Populates |rules| with content setting rules for content types that are | 102 // Populates |rules| with content setting rules for content types that are |
| 106 // handled by the renderer. | 103 // handled by the renderer. |
| 107 void GetRendererContentSettingRules(const HostContentSettingsMap* map, | 104 void GetRendererContentSettingRules(const HostContentSettingsMap* map, |
| 108 RendererContentSettingRules* rules); | 105 RendererContentSettingRules* rules); |
| 109 | 106 |
| 110 } // namespace content_settings | 107 } // namespace content_settings |
| 111 | 108 |
| 112 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_UTILS_H_ | 109 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_UTILS_H_ |
| OLD | NEW |