Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: components/content_settings/core/browser/content_settings_utils.h

Issue 1372353004: Making structure for ContentSettings and its corresponding strings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing nits. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 std::string ContentSettingToString(ContentSetting setting);
63 63
64 ContentSetting ContentSettingFromString(const std::string& name); 64 // Converts a content setting string to the corresponding ContentSetting.
65 // Returns true if |name| specifies a valid content setting, false otherwise.
66 bool ContentSettingFromString(const std::string& name, ContentSetting* setting);
65 67
66 // Converts |Value| to |ContentSetting|. 68 // Converts |Value| to |ContentSetting|.
67 ContentSetting ValueToContentSetting(const base::Value* value); 69 ContentSetting ValueToContentSetting(const base::Value* value);
68 70
69 // Converts a |Value| to a |ContentSetting|. Returns true if |value| encodes 71 // Converts a |Value| to a |ContentSetting|. Returns true if |value| encodes
70 // a valid content setting, false otherwise. Note that |CONTENT_SETTING_DEFAULT| 72 // 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. 73 // is encoded as a NULL value, so it is not allowed as an integer value.
72 bool ParseContentSettingValue(const base::Value* value, 74 bool ParseContentSettingValue(const base::Value* value,
73 ContentSetting* setting); 75 ContentSetting* setting);
74 76
(...skipping 26 matching lines...) Expand all
101 ContentSettingsPattern* secondary_pattern); 103 ContentSettingsPattern* secondary_pattern);
102 104
103 // Populates |rules| with content setting rules for content types that are 105 // Populates |rules| with content setting rules for content types that are
104 // handled by the renderer. 106 // handled by the renderer.
105 void GetRendererContentSettingRules(const HostContentSettingsMap* map, 107 void GetRendererContentSettingRules(const HostContentSettingsMap* map,
106 RendererContentSettingRules* rules); 108 RendererContentSettingRules* rules);
107 109
108 } // namespace content_settings 110 } // namespace content_settings
109 111
110 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_UTILS_H_ 112 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_UTILS_H_
OLDNEW
« no previous file with comments | « chrome/test/data/policy/policy_test_cases.json ('k') | components/content_settings/core/browser/content_settings_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698