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

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

Issue 1862513003: Remove NPAPI from browser and utility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
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 caed15b3a900a9c1b7d07be32f9c35a7d18cd07b..140d00c74a564f7b39ab1e0d361fc17023757e1d 100644
--- a/chrome/browser/plugins/plugin_info_message_filter.cc
+++ b/chrome/browser/plugins/plugin_info_message_filter.cc
@@ -343,18 +343,6 @@ void PluginInfoMessageFilter::Context::DecidePluginStatus(
const WebPluginInfo& plugin,
const PluginMetadata* plugin_metadata,
ChromeViewHostMsg_GetPluginInfo_Status* status) const {
- if (plugin.type == WebPluginInfo::PLUGIN_TYPE_NPAPI) {
- CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
- // NPAPI plugins are not supported inside <webview> guests.
-#if defined(ENABLE_EXTENSIONS)
- if (extensions::WebViewRendererState::GetInstance()->IsGuest(
- render_process_id_)) {
- *status = ChromeViewHostMsg_GetPluginInfo_Status::kNPAPINotSupported;
- return;
- }
-#endif
- }
-
ContentSetting plugin_setting = CONTENT_SETTING_DEFAULT;
bool uses_default_content_setting = true;
bool is_managed = false;
@@ -372,9 +360,9 @@ void PluginInfoMessageFilter::Context::DecidePluginStatus(
DCHECK(plugin_setting != CONTENT_SETTING_DEFAULT);
DCHECK(plugin_setting != CONTENT_SETTING_ASK);
+#if defined(ENABLE_PLUGIN_INSTALLATION)
PluginMetadata::SecurityStatus plugin_status =
plugin_metadata->GetSecurityStatus(plugin);
-#if defined(ENABLE_PLUGIN_INSTALLATION)
// Check if the plugin is outdated.
if (plugin_status == PluginMetadata::SECURITY_STATUS_OUT_OF_DATE &&
!allow_outdated_plugins_.GetValue()) {
@@ -386,28 +374,6 @@ void PluginInfoMessageFilter::Context::DecidePluginStatus(
return;
}
#endif
- // Check if the plugin or its group is enabled by policy.
- PluginPrefs::PolicyStatus plugin_policy =
- plugin_prefs_->PolicyStatusForPlugin(plugin.name);
- PluginPrefs::PolicyStatus group_policy =
- plugin_prefs_->PolicyStatusForPlugin(plugin_metadata->name());
-
- // Check if the plugin requires authorization.
- if (plugin_status ==
- PluginMetadata::SECURITY_STATUS_REQUIRES_AUTHORIZATION &&
- plugin.type != WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS &&
- plugin.type != WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS &&
- plugin.type != WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN &&
piman 2016/04/05 06:00:47 This is always false now (since WebPluginInfo::PLU
- !always_authorize_plugins_.GetValue() &&
- plugin_setting != CONTENT_SETTING_BLOCK &&
- uses_default_content_setting &&
- plugin_policy != PluginPrefs::POLICY_ENABLED &&
- group_policy != PluginPrefs::POLICY_ENABLED &&
- !ChromePluginServiceFilter::GetInstance()->IsPluginRestricted(
- plugin.path)) {
- *status = ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized;
- return;
- }
// Check if the plugin is crashing too much.
if (PluginService::GetInstance()->IsPluginUnstable(plugin.path) &&
@@ -475,19 +441,6 @@ bool PluginInfoMessageFilter::Context::FindEnabledPlugin(
url, mime_type, allow_wildcard, &matching_plugins, &mime_types);
if (matching_plugins.empty()) {
*status = ChromeViewHostMsg_GetPluginInfo_Status::kNotFound;
-#if defined(OS_WIN) || defined(OS_MACOSX)
- if (!PluginService::GetInstance()->NPAPIPluginsSupported()) {
- // At this point it is not known for sure this is an NPAPI plugin as it
- // could be a not-yet-installed Pepper plugin. To avoid notifying on
- // these types, bail early based on a blacklist of pepper mime types.
- for (auto pepper_mime_type : kPepperPluginMimeTypes)
- if (pepper_mime_type == mime_type)
- return false;
-
- ChromePluginServiceFilter::GetInstance()->NPAPIPluginNotFound(
- render_process_id_, render_frame_id, mime_type);
- }
-#endif
return false;
}

Powered by Google App Engine
This is Rietveld 408576698