summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/webplugininfo.h
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-15 09:42:23 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-15 09:42:23 +0000
commit3eff9e2e46c00ec5c0316fef6c44355793f1906d (patch)
treeb4a346aefc756be26707cfa00952d906df8c95ba /webkit/plugins/webplugininfo.h
parent682ef685be471686d07513f4e44e59c9a71cf356 (diff)
downloadchromium_src-3eff9e2e46c00ec5c0316fef6c44355793f1906d.zip
chromium_src-3eff9e2e46c00ec5c0316fef6c44355793f1906d.tar.gz
chromium_src-3eff9e2e46c00ec5c0316fef6c44355793f1906d.tar.bz2
Revert 101269 - Store plug-in enabled/disabled state in PluginPrefs instead of WebPluginInfo, to allow different sets of enabled/disabled plug-ins to be specified per profile.
BUG=80794 TEST=Open two profiles, disable different plugins in them. Review URL: http://codereview.chromium.org/7848025 TBR=bauerb@chromium.org Review URL: http://codereview.chromium.org/7901015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101272 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/webplugininfo.h')
-rw-r--r--webkit/plugins/webplugininfo.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/webkit/plugins/webplugininfo.h b/webkit/plugins/webplugininfo.h
index b7bb4d3..d39c4cd 100644
--- a/webkit/plugins/webplugininfo.h
+++ b/webkit/plugins/webplugininfo.h
@@ -38,6 +38,32 @@ struct WebPluginMimeType {
// Describes an available NPAPI or Pepper plugin.
struct WebPluginInfo {
+ // Defines the possible enabled state a plugin can have.
+ // The enum values actually represent a 3-bit bitfield :
+ // |PE|PD|U| - where |PE|PD| is policy state and U is user state.
+ // PE == 1 means the plugin is forced to enabled state by policy
+ // PD == 1 means the plugin is forced to disabled by policy
+ // PE and PD CAN'T be both 1 but can be both 0 which mean no policy is set.
+ // U == 1 means the user has disabled the plugin.
+ // Because the plugin user state might have been changed before a policy was
+ // introduced the user state might contradict the policy state in which case
+ // the policy has precedence.
+ enum EnabledStates {
+ USER_ENABLED = 0,
+ USER_DISABLED = 1 << 0,
+ POLICY_DISABLED = 1 << 1,
+ POLICY_ENABLED = 1 << 2,
+ USER_ENABLED_POLICY_UNMANAGED = USER_ENABLED,
+ USER_ENABLED_POLICY_DISABLED = USER_ENABLED| POLICY_DISABLED,
+ USER_ENABLED_POLICY_ENABLED = USER_ENABLED | POLICY_ENABLED,
+ USER_DISABLED_POLICY_UNMANAGED = USER_DISABLED,
+ USER_DISABLED_POLICY_DISABLED = USER_DISABLED | POLICY_DISABLED,
+ USER_DISABLED_POLICY_ENABLED = USER_DISABLED | POLICY_ENABLED,
+ USER_MASK = USER_DISABLED,
+ MANAGED_MASK = POLICY_DISABLED | POLICY_ENABLED,
+ POLICY_UNMANAGED = -1
+ };
+
enum PluginType {
PLUGIN_TYPE_NPAPI,
PLUGIN_TYPE_PEPPER_IN_PROCESS,
@@ -70,10 +96,16 @@ struct WebPluginInfo {
// A list of all the mime types that this plugin supports.
std::vector<WebPluginMimeType> mime_types;
+ // Enabled state of the plugin. See the EnabledStates enum.
+ int enabled;
+
// Plugin type. See the PluginType enum.
int type;
};
+// Checks whether a plugin is enabled either by the user or by policy.
+bool IsPluginEnabled(const WebPluginInfo& plugin);
+
// Checks whether a plugin is a Pepper plugin, enabled or disabled.
bool IsPepperPlugin(const WebPluginInfo& plugin);