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

Unified Diff: chrome/browser/component_updater/pepper_flash_component_installer.cc

Issue 2298343002: Allow component-updated Flash to override the placeholder fake Flash even if (Closed)
Patch Set: Created 4 years, 4 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/browser/component_updater/pepper_flash_component_installer.cc
diff --git a/chrome/browser/component_updater/pepper_flash_component_installer.cc b/chrome/browser/component_updater/pepper_flash_component_installer.cc
index 2a84cefd2e3c34b059421bfcc45b81f8a629ed61..9e974858d9c62f1f8f25e36daa59007c13a2c43f 100644
--- a/chrome/browser/component_updater/pepper_flash_component_installer.cc
+++ b/chrome/browser/component_updater/pepper_flash_component_installer.cc
@@ -28,6 +28,7 @@
#include "build/build_config.h"
#include "chrome/browser/plugins/plugin_prefs.h"
#include "chrome/common/chrome_constants.h"
+#include "chrome/common/chrome_content_client.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pepper_flash.h"
@@ -113,12 +114,21 @@ void RegisterPepperFlashWithChrome(const base::FilePath& path,
std::vector<content::WebPluginInfo> plugins;
PluginService::GetInstance()->GetInternalPlugins(&plugins);
+ base::FilePath placeholder_path =
+ base::FilePath::FromUTF8Unsafe(ChromeContentClient::kNotPresent)
for (const auto& plugin : plugins) {
if (!plugin.is_pepper_plugin() || plugin.name != web_plugin.name)
continue;
Version registered_version(base::UTF16ToUTF8(plugin.version));
+ if (plugin.path == placeholder_path) {
Will Harris 2016/08/31 19:38:46 nit: move above line 123
waffles 2016/08/31 20:00:03 Done.
+ // This is the Flash placeholder; replace it regardless of version or
+ // other considerations.
+ PluginService::GetInstance()->UnregisterInternalPlugin(plugin.path);
+ break;
+ }
+
// If lower version, never register.
if (registered_version.IsValid() &&
version.CompareTo(registered_version) < 0) {
« 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