OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_UTILS_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_UTILS_H_ |
6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_UTILS_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... | |
32 bool SupportsResourceIdentifier(ContentSettingsType content_type); | 32 bool SupportsResourceIdentifier(ContentSettingsType content_type); |
33 | 33 |
34 // Maps CONTENT_SETTING_ASK for the CONTENT_SETTINGS_TYPE_PLUGINS to | 34 // Maps CONTENT_SETTING_ASK for the CONTENT_SETTINGS_TYPE_PLUGINS to |
35 // CONTENT_SETTING_BLOCK if click-to-play is not enabled. | 35 // CONTENT_SETTING_BLOCK if click-to-play is not enabled. |
36 ContentSetting ClickToPlayFixup(ContentSettingsType content_type, | 36 ContentSetting ClickToPlayFixup(ContentSettingsType content_type, |
37 ContentSetting setting); | 37 ContentSetting setting); |
38 | 38 |
39 // Converts |Value| to |ContentSetting|. | 39 // Converts |Value| to |ContentSetting|. |
40 ContentSetting ValueToContentSetting(const base::Value* value); | 40 ContentSetting ValueToContentSetting(const base::Value* value); |
41 | 41 |
42 // Tests whether the |value| equals the |setting|. If |value| is not an | |
Bernhard Bauer
2011/11/11 14:00:40
Nit: "a |FundamentalValue|" (not "an").
markusheintz_
2011/11/14 11:15:10
Method removed.
| |
43 // |FundamentalValue| or NULL false is returned. | |
44 bool ValueEqualsContentSetting(const base::Value* value, | |
45 ContentSetting setting); | |
46 | |
42 // Converts a |Value| to a |ContentSetting|. Returns true if |value| encodes | 47 // Converts a |Value| to a |ContentSetting|. Returns true if |value| encodes |
43 // a valid content setting, false otherwise. Note that |CONTENT_SETTING_DEFAULT| | 48 // a valid content setting, false otherwise. Note that |CONTENT_SETTING_DEFAULT| |
44 // is encoded as a NULL value, so it is not allowed as an integer value. | 49 // is encoded as a NULL value, so it is not allowed as an integer value. |
45 bool ParseContentSettingValue(const base::Value* value, | 50 bool ParseContentSettingValue(const base::Value* value, |
46 ContentSetting* setting); | 51 ContentSetting* setting); |
47 | 52 |
48 PatternPair ParsePatternString(const std::string& pattern_str); | 53 PatternPair ParsePatternString(const std::string& pattern_str); |
49 | 54 |
50 std::string CreatePatternString( | 55 std::string CreatePatternString( |
51 const ContentSettingsPattern& item_pattern, | 56 const ContentSettingsPattern& item_pattern, |
(...skipping 29 matching lines...) Expand all Loading... | |
81 const ProviderInterface* provider, | 86 const ProviderInterface* provider, |
82 const GURL& primary_url, | 87 const GURL& primary_url, |
83 const GURL& secondary_url, | 88 const GURL& secondary_url, |
84 ContentSettingsType content_type, | 89 ContentSettingsType content_type, |
85 const std::string& resource_identifier, | 90 const std::string& resource_identifier, |
86 bool include_incognito); | 91 bool include_incognito); |
87 | 92 |
88 } // namespace content_settings | 93 } // namespace content_settings |
89 | 94 |
90 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_UTILS_H_ | 95 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_UTILS_H_ |
OLD | NEW |