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

Unified Diff: chrome/browser/plugins/plugin_info_message_filter.cc

Issue 2284053002: Register a fake Flash with chrome://plugins during browser start-up. (Closed)
Patch Set: Through #18 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 | chrome/common/chrome_content_client.h » ('j') | chrome/common/chrome_content_client.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugins/plugin_info_message_filter.cc
diff --git a/chrome/browser/plugins/plugin_info_message_filter.cc b/chrome/browser/plugins/plugin_info_message_filter.cc
index c650dda7fd7211f6a1fcd2c19d10532c8af456b8..1305a77139a6463340cdfb564e3940c0ddd70dfb 100644
--- a/chrome/browser/plugins/plugin_info_message_filter.cc
+++ b/chrome/browser/plugins/plugin_info_message_filter.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <memory>
#include <utility>
@@ -25,6 +26,7 @@
#include "chrome/browser/plugins/plugins_field_trial.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_otr_state.h"
+#include "chrome/common/chrome_content_client.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/render_messages.h"
#include "components/component_updater/component_updater_service.h"
@@ -404,6 +406,15 @@ bool PluginInfoMessageFilter::Context::FindEnabledPlugin(
std::vector<std::string> mime_types;
PluginService::GetInstance()->GetPluginInfoArray(
url, mime_type, allow_wildcard, &matching_plugins, &mime_types);
+#if defined(GOOGLE_CHROME_BUILD)
+ base::FilePath not_present =
+ base::FilePath::FromUTF8Unsafe(ChromeContentClient::kNotPresent);
+ matching_plugins.erase(
+ std::remove_if(
+ matching_plugins.begin(), matching_plugins.end(),
+ [&](const WebPluginInfo& info) { return info.path == not_present; }),
sky 2016/08/30 03:25:23 Style guide says don't use default capture.
+ matching_plugins.end());
+#endif // defined(GOOGLE_CHROME_BUILD)
if (matching_plugins.empty()) {
*status = ChromeViewHostMsg_GetPluginInfo_Status::kNotFound;
return false;
« no previous file with comments | « no previous file | chrome/common/chrome_content_client.h » ('j') | chrome/common/chrome_content_client.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698