Index: content/browser/plugin_service_impl.cc |
diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc |
index d19f6861c162b2a289d2ca1ccf85a13f3d21bf66..6384f2b667ae796490cf7a4e8b68df38ba485871 100644 |
--- a/content/browser/plugin_service_impl.cc |
+++ b/content/browser/plugin_service_impl.cc |
@@ -144,7 +144,7 @@ PluginServiceImpl* PluginServiceImpl::GetInstance() { |
} |
PluginServiceImpl::PluginServiceImpl() |
- : filter_(NULL) { |
+ : npapi_plugins_enabled_(false), filter_(NULL) { |
// Collect the total number of browser processes (which create |
// PluginServiceImpl objects, to be precise). The number is used to normalize |
// the number of processes which start at least one NPAPI/PPAPI Flash process. |
@@ -181,6 +181,9 @@ void PluginServiceImpl::Init() { |
if (command_line->HasSwitch(switches::kDisablePluginsDiscovery)) |
PluginList::Singleton()->DisablePluginsDiscovery(); |
+#if defined(OS_WIN) || defined(OS_MACOSX) |
+ npapi_plugins_enabled_ = command_line->HasSwitch(switches::kEnableNpapi); |
+#endif |
} |
void PluginServiceImpl::StartWatchingPlugins() { |
@@ -779,17 +782,17 @@ void PluginServiceImpl::GetInternalPlugins( |
} |
bool PluginServiceImpl::NPAPIPluginsSupported() { |
-#if defined(OS_WIN) || defined(OS_MACOSX) |
- return true; |
-#else |
- return false; |
-#endif |
+ return npapi_plugins_enabled_; |
} |
void PluginServiceImpl::DisablePluginsDiscoveryForTesting() { |
PluginList::Singleton()->DisablePluginsDiscovery(); |
} |
+void PluginServiceImpl::EnableNpapiPluginsForTesting() { |
+ npapi_plugins_enabled_ = true; |
+} |
+ |
#if defined(OS_MACOSX) |
void PluginServiceImpl::AppActivated() { |
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |