diff options
Diffstat (limited to 'webkit/plugins/npapi/plugin_group.h')
-rw-r--r-- | webkit/plugins/npapi/plugin_group.h | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/webkit/plugins/npapi/plugin_group.h b/webkit/plugins/npapi/plugin_group.h index 9e0250c..39d9cd1 100644 --- a/webkit/plugins/npapi/plugin_group.h +++ b/webkit/plugins/npapi/plugin_group.h @@ -94,14 +94,24 @@ class PluginGroup { PluginGroup& operator=(const PluginGroup& other); - // Configures the set of plugin name patterns for disabling plugins via - // enterprise configuration management. - static void SetPolicyDisabledPluginPatterns(const std::set<string16>& set); - - // Tests to see if a plugin is on the blacklist using its name as - // the lookup key. + // Configures the set of plugin name patterns for enabling and disabling + // plugins via enterprise configuration management. + static void SetPolicyEnforcedPluginPatterns( + const std::set<string16>& plugins_disabled, + const std::set<string16>& plugins_disabled_exceptions, + const std::set<string16>& plugins_enabled); + + // Tests whether |plugin_name| is disabled by policy. static bool IsPluginNameDisabledByPolicy(const string16& plugin_name); + // Tests whether |plugin_name| within the plugin group |group_name| is + // disabled by policy. + static bool IsPluginFileNameDisabledByPolicy(const string16& plugin_name, + const string16& group_name); + + // Tests whether |plugin_name| is enabled by policy. + static bool IsPluginNameEnabledByPolicy(const string16& plugin_name); + // Returns true if the given plugin matches this group. bool Match(const WebPluginInfo& plugin) const; @@ -245,13 +255,24 @@ class PluginGroup { // Returns true on success. Does not update the group state. static bool Disable(WebPluginInfo* plugin, int reason); + // Helper function to implement the functions above. + static bool SetPluginState(WebPluginInfo* plugin, + int new_reason, + bool state_changes); + // Returns a non-const vector of all plugins in the group. This is only used // by PluginList. std::vector<WebPluginInfo>& GetPluginsContainer() { return web_plugin_infos_; } + // Checks if |name| matches any of the patterns in |pattern_set|. + static bool IsStringMatchedInSet(const string16& name, + const std::set<string16>* pattern_set); + static std::set<string16>* policy_disabled_plugin_patterns_; + static std::set<string16>* policy_disabled_plugin_exception_patterns_; + static std::set<string16>* policy_enabled_plugin_patterns_; std::string identifier_; string16 group_name_; |