Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7988)

Unified Diff: chrome/common/chrome_content_client.cc

Issue 2390613003: Don't add fake flash when command-line flash exists. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/chrome_content_client.cc
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
index 7e0785c44b63184b88778007a3ea71358297bea0..f73a13424593ce89fac419bf4086736d4bc0d4ef 100644
--- a/chrome/common/chrome_content_client.cc
+++ b/chrome/common/chrome_content_client.cc
@@ -280,13 +280,12 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path,
return plugin;
}
-void AddPepperFlashFromCommandLine(
- std::vector<content::PepperPluginInfo>* plugins) {
+bool GetCommandLinePepperFlash(content::PepperPluginInfo* plugin) {
const base::CommandLine::StringType flash_path =
base::CommandLine::ForCurrentProcess()->GetSwitchValueNative(
switches::kPpapiFlashPath);
if (flash_path.empty())
- return;
+ return false;
// Also get the version from the command-line. Should be something like 11.2
// or 11.2.123.45.
@@ -294,9 +293,9 @@ void AddPepperFlashFromCommandLine(
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kPpapiFlashVersion);
- plugins->push_back(
- CreatePepperFlashInfo(base::FilePath(flash_path),
- flash_version, false, true, false));
+ *plugin = CreatePepperFlashInfo(base::FilePath(flash_path),
+ flash_version, false, true, false);
+ return true;
}
#if defined(OS_LINUX)
@@ -487,10 +486,9 @@ void ChromeContentClient::AddPepperPlugins(
std::vector<content::PepperPluginInfo>* plugins) {
#if defined(ENABLE_PLUGINS)
ComputeBuiltInPlugins(plugins);
- AddPepperFlashFromCommandLine(plugins);
#if defined(OS_LINUX)
- // Depending on the sandbox configurtion, the user data directory
+ // Depending on the sandbox configuration, the user data directory
// is not always available. If it is not available, do not try and load any
// flash plugin. The flash player, if any, preloaded before the sandbox
// initialization will continue to be used.
@@ -500,6 +498,10 @@ void ChromeContentClient::AddPepperPlugins(
#endif // defined(OS_LINUX)
ScopedVector<content::PepperPluginInfo> flash_versions;
+ std::unique_ptr<content::PepperPluginInfo> command_line_flash(
+ new content::PepperPluginInfo);
+ if (GetCommandLinePepperFlash(command_line_flash.get()))
+ flash_versions.push_back(command_line_flash.release());
#if defined(OS_LINUX)
std::unique_ptr<content::PepperPluginInfo> component_flash(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698