Chromium Code Reviews| 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 const ContentSettingsPattern& top_level_frame_pattern); | 52 const ContentSettingsPattern& top_level_frame_pattern); |
| 53 | 53 |
| 54 // Caller takes the ownership of the returned |base::Value*|. | 54 // Caller takes the ownership of the returned |base::Value*|. |
| 55 base::Value* GetContentSettingValueAndPatterns( | 55 base::Value* GetContentSettingValueAndPatterns( |
| 56 RuleIterator* rule_iterator, | 56 RuleIterator* rule_iterator, |
| 57 const GURL& primary_url, | 57 const GURL& primary_url, |
| 58 const GURL& secondary_url, | 58 const GURL& secondary_url, |
| 59 ContentSettingsPattern* primary_pattern, | 59 ContentSettingsPattern* primary_pattern, |
| 60 ContentSettingsPattern* secondary_pattern); | 60 ContentSettingsPattern* secondary_pattern); |
| 61 | 61 |
| 62 // Returns a |base::Value*| representation of |setting| if |setting| is | |
| 63 // a valid content setting. Otherwise, returns a nullptr. | |
| 64 base::Value* ContentSettingToValue(ContentSetting setting); | |
|
Bernhard Bauer
2015/04/07 11:00:30
You could return a scoped_ptr here.
msramek
2015/04/08 08:50:57
Done. I agree that it's cleaner (although 3 out of
| |
| 65 | |
| 62 base::Value* GetContentSettingValueAndPatterns( | 66 base::Value* GetContentSettingValueAndPatterns( |
| 63 const ProviderInterface* provider, | 67 const ProviderInterface* provider, |
| 64 const GURL& primary_url, | 68 const GURL& primary_url, |
| 65 const GURL& secondary_url, | 69 const GURL& secondary_url, |
| 66 ContentSettingsType content_type, | 70 ContentSettingsType content_type, |
| 67 const std::string& resource_identifier, | 71 const std::string& resource_identifier, |
| 68 bool include_incognito, | 72 bool include_incognito, |
| 69 ContentSettingsPattern* primary_pattern, | 73 ContentSettingsPattern* primary_pattern, |
| 70 ContentSettingsPattern* secondary_pattern); | 74 ContentSettingsPattern* secondary_pattern); |
| 71 | 75 |
| 72 // Populates |rules| with content setting rules for content types that are | 76 // Populates |rules| with content setting rules for content types that are |
| 73 // handled by the renderer. | 77 // handled by the renderer. |
| 74 void GetRendererContentSettingRules(const HostContentSettingsMap* map, | 78 void GetRendererContentSettingRules(const HostContentSettingsMap* map, |
| 75 RendererContentSettingRules* rules); | 79 RendererContentSettingRules* rules); |
| 76 | 80 |
| 77 } // namespace content_settings | 81 } // namespace content_settings |
| 78 | 82 |
| 79 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_UTILS_H_ | 83 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_UTILS_H_ |
| OLD | NEW |