Removing flow to demote App Launcher to App Host, so app_host.exe can be deleted...
[chromium-blink-merge.git] / chrome / common / content_settings.h
blobbf92413bc10e9d07f593279604856d7b00e9bc95
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.
5 #ifndef CHROME_COMMON_CONTENT_SETTINGS_H_
6 #define CHROME_COMMON_CONTENT_SETTINGS_H_
8 #include <string>
9 #include <vector>
11 #include "chrome/common/content_settings_pattern.h"
12 #include "chrome/common/content_settings_types.h"
14 // Different settings that can be assigned for a particular content type. We
15 // give the user the ability to set these on a global and per-origin basis.
16 enum ContentSetting {
17 CONTENT_SETTING_DEFAULT = 0,
18 CONTENT_SETTING_ALLOW,
19 CONTENT_SETTING_BLOCK,
20 CONTENT_SETTING_ASK,
21 CONTENT_SETTING_SESSION_ONLY,
22 CONTENT_SETTING_NUM_SETTINGS
25 // Range-checked conversion of an int to a ContentSetting, for use when reading
26 // prefs off disk.
27 ContentSetting IntToContentSetting(int content_setting);
29 struct ContentSettingPatternSource {
30 ContentSettingPatternSource(const ContentSettingsPattern& primary_pattern,
31 const ContentSettingsPattern& secondary_patttern,
32 ContentSetting setting,
33 const std::string& source,
34 bool incognito);
35 ContentSettingPatternSource();
36 ContentSettingsPattern primary_pattern;
37 ContentSettingsPattern secondary_pattern;
38 ContentSetting setting;
39 std::string source;
40 bool incognito;
43 typedef std::vector<ContentSettingPatternSource> ContentSettingsForOneType;
45 struct RendererContentSettingRules {
46 RendererContentSettingRules();
47 ~RendererContentSettingRules();
48 ContentSettingsForOneType image_rules;
49 ContentSettingsForOneType script_rules;
52 namespace content_settings {
54 // Enum containing the various source for content settings. Settings can be
55 // set by policy, extension or the user. Certain (internal) schemes are
56 // whilelisted. For whilelisted schemes the source is
57 // |SETTING_SOURCE_WHITELIST|.
58 enum SettingSource {
59 SETTING_SOURCE_NONE,
60 SETTING_SOURCE_POLICY,
61 SETTING_SOURCE_EXTENSION,
62 SETTING_SOURCE_USER,
63 SETTING_SOURCE_WHITELIST,
66 // |SettingInfo| provides meta data for content setting values. |source|
67 // contains the source of a value. |primary_pattern| and |secondary_pattern|
68 // contains the patterns of the appling rule.
69 struct SettingInfo {
70 SettingSource source;
71 ContentSettingsPattern primary_pattern;
72 ContentSettingsPattern secondary_pattern;
75 } // namespace content_settings
77 #endif // CHROME_COMMON_CONTENT_SETTINGS_H_