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

Unified Diff: webkit/plugins/npapi/webplugininfo.h

Issue 5699005: Policy: Re-enabled plugin still disabled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespace fixes only. Trybot happiness still applies. Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/plugins/npapi/plugin_list_win.cc ('k') | webkit/plugins/npapi/webplugininfo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/npapi/webplugininfo.h
diff --git a/webkit/plugins/npapi/webplugininfo.h b/webkit/plugins/npapi/webplugininfo.h
index 859665c1963614f0aa6b4ca3cf88b28c4c0fb4a0..c4e58ed5d2b2502c0ee38e1a360229680d3dec5f 100644
--- a/webkit/plugins/npapi/webplugininfo.h
+++ b/webkit/plugins/npapi/webplugininfo.h
@@ -31,6 +31,32 @@ struct WebPluginMimeType {
// Describes an available NPAPI 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
+ };
+
WebPluginInfo();
WebPluginInfo(const WebPluginInfo& rhs);
~WebPluginInfo();
@@ -57,10 +83,13 @@ struct WebPluginInfo {
// A list of all the mime types that this plugin supports.
std::vector<WebPluginMimeType> mime_types;
- // Whether the plugin is enabled.
- bool enabled;
+ // Enabled state of the plugin. See the EnabledStates enum.
+ int enabled;
};
+// Checks whether a plugin is enabled either by the user or by policy.
+bool IsPluginEnabled(const WebPluginInfo& plugin);
+
} // namespace npapi
} // namespace webkit
« no previous file with comments | « webkit/plugins/npapi/plugin_list_win.cc ('k') | webkit/plugins/npapi/webplugininfo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698