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

Side by Side Diff: chrome/common/content_settings.h

Issue 541813002: Componentize chrome/common/content_settings files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: GN fix Created 6 years, 3 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
« no previous file with comments | « chrome/common/common_param_traits_macros.h ('k') | chrome/common/content_settings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_COMMON_CONTENT_SETTINGS_H_
6 #define CHROME_COMMON_CONTENT_SETTINGS_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "components/content_settings/core/common/content_settings_pattern.h"
12
13 // Different settings that can be assigned for a particular content type. We
14 // give the user the ability to set these on a global and per-origin basis.
15 enum ContentSetting {
16 CONTENT_SETTING_DEFAULT = 0,
17 CONTENT_SETTING_ALLOW,
18 CONTENT_SETTING_BLOCK,
19 CONTENT_SETTING_ASK,
20 CONTENT_SETTING_SESSION_ONLY,
21 CONTENT_SETTING_NUM_SETTINGS
22 };
23
24 // Range-checked conversion of an int to a ContentSetting, for use when reading
25 // prefs off disk.
26 ContentSetting IntToContentSetting(int content_setting);
27
28 struct ContentSettingPatternSource {
29 ContentSettingPatternSource(const ContentSettingsPattern& primary_pattern,
30 const ContentSettingsPattern& secondary_patttern,
31 ContentSetting setting,
32 const std::string& source,
33 bool incognito);
34 ContentSettingPatternSource();
35 ContentSettingsPattern primary_pattern;
36 ContentSettingsPattern secondary_pattern;
37 ContentSetting setting;
38 std::string source;
39 bool incognito;
40 };
41
42 typedef std::vector<ContentSettingPatternSource> ContentSettingsForOneType;
43
44 struct RendererContentSettingRules {
45 RendererContentSettingRules();
46 ~RendererContentSettingRules();
47 ContentSettingsForOneType image_rules;
48 ContentSettingsForOneType script_rules;
49 };
50
51 namespace content_settings {
52
53 // Enum containing the various source for content settings. Settings can be
54 // set by policy, extension or the user. Certain (internal) schemes are
55 // whilelisted. For whilelisted schemes the source is
56 // |SETTING_SOURCE_WHITELIST|.
57 enum SettingSource {
58 SETTING_SOURCE_NONE,
59 SETTING_SOURCE_POLICY,
60 SETTING_SOURCE_EXTENSION,
61 SETTING_SOURCE_USER,
62 SETTING_SOURCE_WHITELIST,
63 };
64
65 // |SettingInfo| provides meta data for content setting values. |source|
66 // contains the source of a value. |primary_pattern| and |secondary_pattern|
67 // contains the patterns of the appling rule.
68 struct SettingInfo {
69 SettingSource source;
70 ContentSettingsPattern primary_pattern;
71 ContentSettingsPattern secondary_pattern;
72 };
73
74 } // namespace content_settings
75
76 #endif // CHROME_COMMON_CONTENT_SETTINGS_H_
OLDNEW
« no previous file with comments | « chrome/common/common_param_traits_macros.h ('k') | chrome/common/content_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698