summaryrefslogtreecommitdiffstats
path: root/chrome/browser/plugin_service.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/plugin_service.h')
-rw-r--r--chrome/browser/plugin_service.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/chrome/browser/plugin_service.h b/chrome/browser/plugin_service.h
index 6933895..8bcbf7c 100644
--- a/chrome/browser/plugin_service.h
+++ b/chrome/browser/plugin_service.h
@@ -12,6 +12,7 @@
#include "base/basictypes.h"
#include "base/hash_tables.h"
+#include "base/lock.h"
#include "base/ref_counted.h"
#include "base/singleton.h"
#include "base/waitable_event_watcher.h"
@@ -35,8 +36,8 @@ class URLRequestContext;
class ResourceDispatcherHost;
class ResourceMessageFilter;
-// This must be created on the main thread but it's only called on the IO/file
-// thread.
+// This can be called on the main thread and IO thread. However it must
+// be created on the main thread.
class PluginService
: public base::WaitableEventWatcher::Delegate,
public NotificationObserver {
@@ -44,6 +45,9 @@ class PluginService
// Returns the PluginService singleton.
static PluginService* GetInstance();
+ // Gets the list of available plugins.
+ void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins);
+
// Load all the plugins that should be loaded for the lifetime of the browser
// (ie, with the LoadOnStartup flag set).
void LoadChromePlugins(ResourceDispatcherHost* resource_dispatcher_host);
@@ -78,6 +82,8 @@ class PluginService
const std::wstring& locale,
IPC::Message* reply_msg);
+ bool HavePluginFor(const std::string& mime_type, bool allow_wildcard);
+
// Get the path to the plugin specified. policy_url is the URL of the page
// requesting the plugin, so we can verify whether the plugin is allowed
// on that page.
@@ -109,6 +115,9 @@ class PluginService
virtual void Observe(NotificationType type, const NotificationSource& source,
const NotificationDetails& details);
+ // Get plugin info by matching full path.
+ bool GetPluginInfoByPath(const FilePath& plugin_path, WebPluginInfo* info);
+
// Returns true if the given plugin is allowed to be used by a page with
// the given URL.
bool PluginAllowedForURL(const FilePath& plugin_path, const GURL& url);
@@ -134,6 +143,10 @@ class PluginService
typedef base::hash_map<FilePath, GURL> PrivatePluginMap;
PrivatePluginMap private_plugins_;
+ // Need synchronization whenever we access the plugin_list singelton through
+ // webkit_glue since this class is called on the main and IO thread.
+ Lock lock_;
+
NotificationRegistrar registrar_;
#if defined(OS_WIN)