diff options
-rw-r--r-- | chrome/browser/plugin_service.cc | 8 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 3 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 |
3 files changed, 12 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() { diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index edd77df..39bb988 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -355,6 +355,9 @@ const wchar_t kInstallExtension[] = L"install-extension"; // Load an extension from the specified directory. const wchar_t kLoadExtension[] = L"load-extension"; +// Load an NPAPI plugin from the specified path. +const wchar_t kLoadPlugin[] = L"load-plugin"; + // Causes the browser to launch directly in incognito mode. const wchar_t kIncognito[] = L"incognito"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 6f9946b..64978c2 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -134,6 +134,7 @@ extern const wchar_t kEnableUserScripts[]; extern const wchar_t kEnableExtensions[]; extern const wchar_t kInstallExtension[]; extern const wchar_t kLoadExtension[]; +extern const wchar_t kLoadPlugin[]; extern const wchar_t kIncognito[]; extern const wchar_t kUseOldSafeBrowsing[]; |