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

Side by Side Diff: components/content_settings/core/common/content_settings.h

Issue 2938163002: Store base::Value in ContentSettingPatternSource instead of an enum (Closed)
Patch Set: rebased Created 3 years, 5 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) 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
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 std::unique_ptr<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 ContentSetting GetContentSetting() const;
58
51 ContentSettingsPattern primary_pattern; 59 ContentSettingsPattern primary_pattern;
52 ContentSettingsPattern secondary_pattern; 60 ContentSettingsPattern secondary_pattern;
53 ContentSetting setting; 61 std::unique_ptr<base::Value> setting_value;
54 std::string source; 62 std::string source;
55 bool incognito; 63 bool incognito;
56 }; 64 };
57 65
58 typedef std::vector<ContentSettingPatternSource> ContentSettingsForOneType; 66 typedef std::vector<ContentSettingPatternSource> ContentSettingsForOneType;
59 67
60 struct RendererContentSettingRules { 68 struct RendererContentSettingRules {
61 RendererContentSettingRules(); 69 RendererContentSettingRules();
62 ~RendererContentSettingRules(); 70 ~RendererContentSettingRules();
63 ContentSettingsForOneType image_rules; 71 ContentSettingsForOneType image_rules;
(...skipping 23 matching lines...) Expand all
87 // contains the patterns of the appling rule. 95 // contains the patterns of the appling rule.
88 struct SettingInfo { 96 struct SettingInfo {
89 SettingSource source; 97 SettingSource source;
90 ContentSettingsPattern primary_pattern; 98 ContentSettingsPattern primary_pattern;
91 ContentSettingsPattern secondary_pattern; 99 ContentSettingsPattern secondary_pattern;
92 }; 100 };
93 101
94 } // namespace content_settings 102 } // namespace content_settings
95 103
96 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_H_ 104 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_H_
OLDNEW
« no previous file with comments | « components/content_settings/core/common/OWNERS ('k') | components/content_settings/core/common/content_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698