Commit 30f12cd9 authored by waffles's avatar waffles Committed by Commit bot

Allow component-updated Flash to override the placeholder fake Flash even if

the version is lower.

BUG=642323

Review-Url: https://codereview.chromium.org/2298343002
Cr-Commit-Position: refs/heads/master@{#415781}
parent 5d908b66
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/plugins/plugin_prefs.h" #include "chrome/browser/plugins/plugin_prefs.h"
#include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "chrome/common/pepper_flash.h" #include "chrome/common/pepper_flash.h"
...@@ -113,10 +114,19 @@ void RegisterPepperFlashWithChrome(const base::FilePath& path, ...@@ -113,10 +114,19 @@ void RegisterPepperFlashWithChrome(const base::FilePath& path,
std::vector<content::WebPluginInfo> plugins; std::vector<content::WebPluginInfo> plugins;
PluginService::GetInstance()->GetInternalPlugins(&plugins); PluginService::GetInstance()->GetInternalPlugins(&plugins);
base::FilePath placeholder_path =
base::FilePath::FromUTF8Unsafe(ChromeContentClient::kNotPresent)
for (const auto& plugin : plugins) { for (const auto& plugin : plugins) {
if (!plugin.is_pepper_plugin() || plugin.name != web_plugin.name) if (!plugin.is_pepper_plugin() || plugin.name != web_plugin.name)
continue; continue;
if (plugin.path == placeholder_path) {
// This is the Flash placeholder; replace it regardless of version or
// other considerations.
PluginService::GetInstance()->UnregisterInternalPlugin(plugin.path);
break;
}
Version registered_version(base::UTF16ToUTF8(plugin.version)); Version registered_version(base::UTF16ToUTF8(plugin.version));
// If lower version, never register. // If lower version, never register.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment