Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / extensions / api / content_settings / content_settings_helpers.h
blobdb82fe4c86d25cf857512e161241bb399e92d9d0
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_CONTENT_SETTINGS_CONTENT_SETTINGS_HELPERS_H__
6 #define CHROME_BROWSER_EXTENSIONS_API_CONTENT_SETTINGS_CONTENT_SETTINGS_HELPERS_H__
8 #include <string>
10 #include "components/content_settings/core/common/content_settings.h"
11 #include "components/content_settings/core/common/content_settings_pattern.h"
12 #include "components/content_settings/core/common/content_settings_types.h"
14 namespace extensions {
15 namespace content_settings_helpers {
17 // Parses an extension match pattern and returns a corresponding
18 // content settings pattern object.
19 // If |pattern_str| is invalid or can't be converted to a content settings
20 // pattern, |error| is set to the parsing error and an invalid pattern
21 // is returned.
22 ContentSettingsPattern ParseExtensionPattern(const std::string& pattern_str,
23 std::string* error);
25 // Converts a content settings type string to the corresponding
26 // ContentSettingsType. Returns CONTENT_SETTINGS_TYPE_DEFAULT if the string
27 // didn't specify a valid content settings type.
28 ContentSettingsType StringToContentSettingsType(
29 const std::string& content_type);
30 // Returns a string representation of a ContentSettingsType.
31 const char* ContentSettingsTypeToString(ContentSettingsType type);
33 // Converts a content setting string to the corresponding ContentSetting.
34 // Returns true if |setting_str| specifies a valid content setting,
35 // false otherwise.
36 bool StringToContentSetting(const std::string& setting_str,
37 ContentSetting* setting);
38 // Returns a string representation of a ContentSetting.
39 const char* ContentSettingToString(ContentSetting setting);
41 } // namespace content_settings_helpers
42 } // namespace extensions
44 #endif // CHROME_BROWSER_EXTENSIONS_API_CONTENT_SETTINGS_CONTENT_SETTINGS_HELPERS_H__