summaryrefslogtreecommitdiffstats
path: root/chrome/browser/plugin_updater.h
diff options
context:
space:
mode:
authordanno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-10 13:55:18 +0000
committerdanno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-10 13:55:18 +0000
commit492d214950b16d229ced62021486e9e0ec859e40 (patch)
treeac098e0dc234b894433b13d409ddb198cd9d24b1 /chrome/browser/plugin_updater.h
parent0ef5163fe4f9a76f516f09f7aa9d19c322e79691 (diff)
downloadchromium_src-492d214950b16d229ced62021486e9e0ec859e40.zip
chromium_src-492d214950b16d229ced62021486e9e0ec859e40.tar.gz
chromium_src-492d214950b16d229ced62021486e9e0ec859e40.tar.bz2
Policy: plugins disabled by policy should honor policy changes without Chrome relaunch.
BUG=54620 TEST=PrefChangeRegistrarTest.* Review URL: http://codereview.chromium.org/3316007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59094 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_updater.h')
-rw-r--r--chrome/browser/plugin_updater.h69
1 files changed, 53 insertions, 16 deletions
diff --git a/chrome/browser/plugin_updater.h b/chrome/browser/plugin_updater.h
index b847162..d046d46 100644
--- a/chrome/browser/plugin_updater.h
+++ b/chrome/browser/plugin_updater.h
@@ -6,36 +6,73 @@
#define CHROME_BROWSER_PLUGIN_UPDATER_H_
#pragma once
+#include <vector>
+
#include "base/basictypes.h"
#include "base/file_path.h"
#include "base/linked_ptr.h"
#include "base/singleton.h"
+#include "chrome/common/notification_observer.h"
+class DictionaryValue;
class ListValue;
+class NotificationDetails;
+class NotificationSource;
+class PluginGroup;
class Profile;
+struct WebPluginInfo;
+
+class PluginUpdater : public NotificationObserver {
+ public:
+ // Get a list of all the Plugin groups.
+ ListValue* GetPluginGroupsData();
+
+ // Enable or disable a plugin group.
+ void EnablePluginGroup(bool enable, const string16& group_name);
+
+ // Enable or disable a specific plugin file.
+ void EnablePluginFile(bool enable, const FilePath::StringType& file_path);
+
+ // Disable all plugin groups as defined by the user's preference file.
+ void DisablePluginGroupsFromPrefs(Profile* profile);
+
+ // Disable all plugins groups that are known to be outdated, according to
+ // the information hardcoded in PluginGroup, to make sure that they can't
+ // be loaded on a web page and instead show a UI to update to the latest
+ // version.
+ void DisableOutdatedPluginGroups();
+
+ // Write the enable/disable status to the user's preference file.
+ void UpdatePreferences(Profile* profile);
+
+ // NotificationObserver method overrides
+ void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
-namespace plugin_updater {
+ static PluginUpdater* GetPluginUpdater();
-// Get a list of all the Plugin groups.
-ListValue* GetPluginGroupsData();
+ private:
+ PluginUpdater();
+ virtual ~PluginUpdater() {}
-// Enable or disable a plugin group.
-void EnablePluginGroup(bool enable, const string16& group_name);
+ // Note: if you change this to false from true, you must update
+ // kPluginsEnabledInternalPDF to be a new name (i.e. add 2, 3, 4...) at end.
+ bool enable_internal_pdf_;
-// Enable or disable a specific plugin file.
-void EnablePluginFile(bool enable, const FilePath::StringType& file_path);
+ DictionaryValue* CreatePluginFileSummary(const WebPluginInfo& plugin);
-// Disable all plugin groups as defined by the user's preference file.
-void DisablePluginGroupsFromPrefs(Profile* profile);
+ // Convert to a List of Groups
+ void GetPluginGroups(std::vector<linked_ptr<PluginGroup> >* plugin_groups);
-// Disable all plugins groups that are known to be outdated, according to the
-// information hardcoded in PluginGroup, to make sure that they can't be loaded
-// on a web page and instead show a UI to update to the latest version.
-void DisableOutdatedPluginGroups();
+ // 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);
-// Write the enable/disable status to the user's preference file.
-void UpdatePreferences(Profile* profile);
+ // Needed to allow singleton instantiation using private constructor.
+ friend struct DefaultSingletonTraits<PluginUpdater>;
-} // namespace plugin_updater
+ DISALLOW_COPY_AND_ASSIGN(PluginUpdater);
+};
#endif // CHROME_BROWSER_PLUGIN_UPDATER_H_