diff options
author | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-12 20:57:54 +0000 |
---|---|---|
committer | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-12 20:57:54 +0000 |
commit | d48f1e0c85c0fda7e02a9f5d6e99740cc37b47b9 (patch) | |
tree | ac01802dbedcbc95626d8580e80d113808341d55 /chrome/browser/plugin_service.cc | |
parent | 28ab0d3189c14d4061240ec4471e16de11fa0f7c (diff) | |
download | chromium_src-d48f1e0c85c0fda7e02a9f5d6e99740cc37b47b9.zip chromium_src-d48f1e0c85c0fda7e02a9f5d6e99740cc37b47b9.tar.gz chromium_src-d48f1e0c85c0fda7e02a9f5d6e99740cc37b47b9.tar.bz2 |
Add a --load-plugin flag to load an NPAPI plugin from an arbitrary location.
This is to support running Chromebot to exercise a given NPAPI plugin.
Review URL: http://codereview.chromium.org/21279
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9701 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_service.cc')
-rw-r--r-- | chrome/browser/plugin_service.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/plugin_service.cc b/chrome/browser/plugin_service.cc index cf72d07..d36cc69 100644 --- a/chrome/browser/plugin_service.cc +++ b/chrome/browser/plugin_service.cc @@ -4,6 +4,7 @@ #include "chrome/browser/plugin_service.h" +#include "base/command_line.h" #include "base/singleton.h" #include "base/thread.h" #include "chrome/browser/browser_process.h" @@ -13,6 +14,7 @@ #include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/browser/renderer_host/resource_message_filter.h" #include "chrome/common/chrome_plugin_lib.h" +#include "chrome/common/chrome_switches.h" #include "chrome/common/logging_chrome.h" #include "webkit/glue/plugins/plugin_list.h" @@ -28,6 +30,12 @@ PluginService::PluginService() plugin_shutdown_handler_(new ShutdownHandler) { // Have the NPAPI plugin list search for Chrome plugins as well. ChromePluginLib::RegisterPluginsWithNPAPI(); + + // Load the one specified on the command line as well. + const CommandLine* command_line = CommandLine::ForCurrentProcess(); + std::wstring path = command_line->GetSwitchValue(switches::kLoadPlugin); + if (!path.empty()) + NPAPI::PluginList::AddExtraPluginPath(FilePath::FromWStringHack(path)); } PluginService::~PluginService() { |