summaryrefslogtreecommitdiffstats
path: root/chrome/browser/plugin_service.h
diff options
context:
space:
mode:
authorgspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-14 23:59:26 +0000
committergspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-14 23:59:26 +0000
commit6fdd418b9a50f24f7788e229bd3ae4acaf6ec1d4 (patch)
treed55a82a8551a7df61d6c84f13835e7b8e17507f3 /chrome/browser/plugin_service.h
parent6f7582fd31ff06faa0298ab6d530369256e9f20a (diff)
downloadchromium_src-6fdd418b9a50f24f7788e229bd3ae4acaf6ec1d4.zip
chromium_src-6fdd418b9a50f24f7788e229bd3ae4acaf6ec1d4.tar.gz
chromium_src-6fdd418b9a50f24f7788e229bd3ae4acaf6ec1d4.tar.bz2
This adds a plugin selection policy for selecting which plugin is
allowed for a particular domain. It is only used on ChromeOS. It reads from a file that is installed in a known location on ChromeOS, and uses that as it's policy. When there are multiple plugins supporting the same mime-type, the appropriate plugin file to load is now selected based on policy. BUG=http://crosbug.com/7403 TEST=ran new unit test, tested on device. Review URL: http://codereview.chromium.org/3717005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62679 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_service.h')
-rw-r--r--chrome/browser/plugin_service.h38
1 files changed, 36 insertions, 2 deletions
diff --git a/chrome/browser/plugin_service.h b/chrome/browser/plugin_service.h
index 3f25c25..9ff7988 100644
--- a/chrome/browser/plugin_service.h
+++ b/chrome/browser/plugin_service.h
@@ -25,6 +25,12 @@
#include "base/scoped_ptr.h"
#endif
+#if defined(OS_CHROMEOS)
+namespace chromeos {
+class PluginSelectionPolicy;
+}
+#endif
+
namespace IPC {
class Message;
}
@@ -32,9 +38,10 @@ class Message;
class MessageLoop;
class PluginProcessHost;
class Profile;
-class URLRequestContext;
class ResourceDispatcherHost;
class ResourceMessageFilter;
+class URLRequestContext;
+struct WebPluginInfo;
// This must be created on the main thread but it's only called on the IO/file
// thread.
@@ -78,9 +85,15 @@ class PluginService
void OpenChannelToPlugin(ResourceMessageFilter* renderer_msg_filter,
const GURL& url,
const std::string& mime_type,
- const std::string& locale,
IPC::Message* reply_msg);
+ // Gets the first allowed plugin in the list of plugins that matches
+ // the given url and mime type. Must be called on the FILE thread.
+ bool GetFirstAllowedPluginInfo(const GURL& url,
+ const std::string& mime_type,
+ WebPluginInfo* info,
+ std::string* actual_mime_type);
+
// Returns true if the given plugin is allowed to be used by a page with
// the given URL.
bool PrivatePluginAllowedForURL(const FilePath& plugin_path, const GURL& url);
@@ -111,6 +124,21 @@ class PluginService
void RegisterPepperPlugins();
+ // Helper so we can do the plugin lookup on the FILE thread.
+ void GetAllowedPluginForOpenChannelToPlugin(
+ ResourceMessageFilter* renderer_msg_filter,
+ const GURL& url,
+ const std::string& mime_type,
+ IPC::Message* reply_msg);
+
+ // Helper so we can finish opening the channel after looking up the
+ // plugin.
+ void FinishOpenChannelToPlugin(
+ ResourceMessageFilter* renderer_msg_filter,
+ const std::string& mime_type,
+ const FilePath& plugin_path,
+ IPC::Message* reply_msg);
+
// mapping between plugin path and PluginProcessHost
typedef base::hash_map<FilePath, PluginProcessHost*> PluginMap;
PluginMap plugin_hosts_;
@@ -134,6 +162,10 @@ class PluginService
NotificationRegistrar registrar_;
+#if defined(OS_CHROMEOS)
+ scoped_refptr<chromeos::PluginSelectionPolicy> plugin_selection_policy_;
+#endif
+
#if defined(OS_WIN)
// Registry keys for getting notifications when new plugins are installed.
RegKey hkcu_key_;
@@ -150,4 +182,6 @@ class PluginService
DISALLOW_COPY_AND_ASSIGN(PluginService);
};
+DISABLE_RUNNABLE_METHOD_REFCOUNT(PluginService);
+
#endif // CHROME_BROWSER_PLUGIN_SERVICE_H_