| 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 COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_H_ | 5 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_H_ |
| 6 #define COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_H_ | 6 #define COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> |
| 10 #include <string> | 11 #include <string> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 14 #include "base/memory/ptr_util.h" |
| 15 #include "base/values.h" |
| 13 #include "components/content_settings/core/common/content_settings_pattern.h" | 16 #include "components/content_settings/core/common/content_settings_pattern.h" |
| 14 #include "components/content_settings/core/common/content_settings_types.h" | 17 #include "components/content_settings/core/common/content_settings_types.h" |
| 15 | 18 |
| 16 // Different settings that can be assigned for a particular content type. We | 19 // Different settings that can be assigned for a particular content type. We |
| 17 // give the user the ability to set these on a global and per-origin basis. | 20 // give the user the ability to set these on a global and per-origin basis. |
| 18 // A Java counterpart will be generated for this enum. | 21 // A Java counterpart will be generated for this enum. |
| 19 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.preferences.website | 22 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.preferences.website |
| 20 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: ContentSettingValues | 23 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: ContentSettingValues |
| 21 // | 24 // |
| 22 // TODO(nigeltao): migrate the Java users of this enum to the mojom-generated | 25 // TODO(nigeltao): migrate the Java users of this enum to the mojom-generated |
| (...skipping 13 matching lines...) Expand all Loading... |
| 36 ContentSetting IntToContentSetting(int content_setting); | 39 ContentSetting IntToContentSetting(int content_setting); |
| 37 | 40 |
| 38 // Converts a given content setting to its histogram value, for use when saving | 41 // Converts a given content setting to its histogram value, for use when saving |
| 39 // content settings types to a histogram. | 42 // content settings types to a histogram. |
| 40 int ContentSettingTypeToHistogramValue(ContentSettingsType content_setting, | 43 int ContentSettingTypeToHistogramValue(ContentSettingsType content_setting, |
| 41 size_t* num_values); | 44 size_t* num_values); |
| 42 | 45 |
| 43 struct ContentSettingPatternSource { | 46 struct ContentSettingPatternSource { |
| 44 ContentSettingPatternSource(const ContentSettingsPattern& primary_pattern, | 47 ContentSettingPatternSource(const ContentSettingsPattern& primary_pattern, |
| 45 const ContentSettingsPattern& secondary_patttern, | 48 const ContentSettingsPattern& secondary_patttern, |
| 46 ContentSetting setting, | 49 const base::Value& setting_value, |
| 47 const std::string& source, | 50 const std::string& source, |
| 48 bool incognito); | 51 bool incognito); |
| 49 ContentSettingPatternSource(const ContentSettingPatternSource& other); | 52 ContentSettingPatternSource(const ContentSettingPatternSource& other); |
| 50 ContentSettingPatternSource(); | 53 ContentSettingPatternSource(); |
| 54 ContentSettingPatternSource& operator=( |
| 55 const ContentSettingPatternSource& other); |
| 56 ~ContentSettingPatternSource(); |
| 57 |
| 51 ContentSettingsPattern primary_pattern; | 58 ContentSettingsPattern primary_pattern; |
| 52 ContentSettingsPattern secondary_pattern; | 59 ContentSettingsPattern secondary_pattern; |
| 53 ContentSetting setting; | 60 std::unique_ptr<base::Value> setting_value; |
| 54 std::string source; | 61 std::string source; |
| 55 bool incognito; | 62 bool incognito; |
| 56 }; | 63 }; |
| 57 | 64 |
| 58 typedef std::vector<ContentSettingPatternSource> ContentSettingsForOneType; | 65 typedef std::vector<ContentSettingPatternSource> ContentSettingsForOneType; |
| 59 | 66 |
| 60 struct RendererContentSettingRules { | 67 struct RendererContentSettingRules { |
| 61 RendererContentSettingRules(); | 68 RendererContentSettingRules(); |
| 62 ~RendererContentSettingRules(); | 69 ~RendererContentSettingRules(); |
| 63 ContentSettingsForOneType image_rules; | 70 ContentSettingsForOneType image_rules; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 87 // contains the patterns of the appling rule. | 94 // contains the patterns of the appling rule. |
| 88 struct SettingInfo { | 95 struct SettingInfo { |
| 89 SettingSource source; | 96 SettingSource source; |
| 90 ContentSettingsPattern primary_pattern; | 97 ContentSettingsPattern primary_pattern; |
| 91 ContentSettingsPattern secondary_pattern; | 98 ContentSettingsPattern secondary_pattern; |
| 92 }; | 99 }; |
| 93 | 100 |
| 94 } // namespace content_settings | 101 } // namespace content_settings |
| 95 | 102 |
| 96 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_H_ | 103 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_H_ |
| OLD | NEW |