summaryrefslogtreecommitdiffstats
path: root/chrome/browser/plugin_updater.h
diff options
context:
space:
mode:
authorpastarmovj@chromium.org <pastarmovj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-01 13:28:58 +0000
committerpastarmovj@chromium.org <pastarmovj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-01 13:28:58 +0000
commit24ff43d70bfae58e5b7fe4c607fe255ca1c665dd (patch)
treea02df6c3e178747e8b79adceb2a8f3307c7d4155 /chrome/browser/plugin_updater.h
parent3ce02419d4f7b3cd1fc062f87fb63a78072b5483 (diff)
downloadchromium_src-24ff43d70bfae58e5b7fe4c607fe255ca1c665dd.zip
chromium_src-24ff43d70bfae58e5b7fe4c607fe255ca1c665dd.tar.gz
chromium_src-24ff43d70bfae58e5b7fe4c607fe255ca1c665dd.tar.bz2
Added EnabledPlugins policy.
The EnabledPlugins policy is linked to the plugins.plugins_whitelist preference. Renamed some methods to clarify that policies can both disable and enable plugins. Updated plugins.html (about:plugins) to display policy-enabled plugins. Lots of tweaks in PluginGroup and PluginList (webkit/plugins/npapi) to preserve the user's preference across policy changes. Removing a policy on a plugin restores the state that the user had configured before. TODO: The interaction of "EnabledPlugins" and "DisabledPlugins" when overlapping isn't very well addressed yet. Currently, any plugin matching the "disabled" list will be disabled, regardless of matching or not the "enabled" list. Small fixes: Added missing "noPlugins" string to the jstemplate strings for plugins.html. BUG=55022 TEST=Create a policy enabling a specific plugin and check about:plugins. Also test_shell_test PluginGroupTest.ManagedByPolicy, and unit_tests. Review URL: http://codereview.chromium.org/6469068 Patch from Joao da Silva <joaodasilva@chromium.org>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76373 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_updater.h')
-rw-r--r--chrome/browser/plugin_updater.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/chrome/browser/plugin_updater.h b/chrome/browser/plugin_updater.h
index b30418e..c5583fa 100644
--- a/chrome/browser/plugin_updater.h
+++ b/chrome/browser/plugin_updater.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_PLUGIN_UPDATER_H_
#pragma once
+#include <set>
#include <vector>
#include "base/basictypes.h"
@@ -38,8 +39,8 @@ class PluginUpdater : public NotificationObserver {
// Enable or disable a specific plugin file.
void EnablePlugin(bool enable, const FilePath::StringType& file_path);
- // Disable all plugin groups as defined by the user's preference file.
- void DisablePluginGroupsFromPrefs(Profile* profile);
+ // Enable or disable plugin groups as defined by the user's preference file.
+ void UpdatePluginGroupsStateFromPrefs(Profile* profile);
// Write the enable/disable status to the user's preference file.
void UpdatePreferences(Profile* profile, int delay_ms);
@@ -75,9 +76,15 @@ class PluginUpdater : public NotificationObserver {
static DictionaryValue* CreatePluginFileSummary(
const webkit::npapi::WebPluginInfo& plugin);
- // Force plugins to be disabled due to policy. |plugins| contains
- // the list of StringValues of the names of the policy-disabled plugins.
- void DisablePluginsFromPolicy(const ListValue* plugin_names);
+ // Force plugins to be enabled or disabled due to policy.
+ // |disabled_list| contains the list of StringValues of the names of the
+ // policy-disabled plugins, |exceptions_list| the policy-allowed plugins,
+ // and |enabled_list| the policy-enabled plugins.
+ void UpdatePluginsStateFromPolicy(const ListValue* disabled_list,
+ const ListValue* exceptions_list,
+ const ListValue* enabled_list);
+
+ void ListValueToStringSet(const ListValue* src, std::set<string16>* dest);
// Needed to allow singleton instantiation using private constructor.
friend struct DefaultSingletonTraits<PluginUpdater>;