Index: chrome/browser/plugins/flash_download_interception.cc |
diff --git a/chrome/browser/plugins/flash_download_interception.cc b/chrome/browser/plugins/flash_download_interception.cc |
index 887ab7985fd233c2fad1998a6ec632d0cae6d21e..13e0e164f72c8cd5ce18c9bec1bd06ee46edcb4f 100644 |
--- a/chrome/browser/plugins/flash_download_interception.cc |
+++ b/chrome/browser/plugins/flash_download_interception.cc |
@@ -7,7 +7,11 @@ |
#include "base/bind.h" |
#include "base/memory/ptr_util.h" |
#include "base/strings/string_util.h" |
+#include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
+#include "chrome/browser/plugins/plugins_field_trial.h" |
+#include "chrome/browser/profiles/profile.h" |
#include "chrome/common/chrome_features.h" |
+#include "components/content_settings/core/browser/host_content_settings_map.h" |
#include "components/navigation_interception/intercept_navigation_throttle.h" |
#include "components/navigation_interception/navigation_params.h" |
#include "content/public/browser/browser_thread.h" |
@@ -48,6 +52,24 @@ FlashDownloadInterception::MaybeCreateThrottleFor(NavigationHandle* handle) { |
return nullptr; |
} |
+ Profile* profile = Profile::FromBrowserContext( |
+ handle->GetWebContents()->GetBrowserContext()); |
+ HostContentSettingsMap* host_content_settings_map = |
+ HostContentSettingsMapFactory::GetForProfile(profile); |
+ GURL page_url = handle->GetWebContents()->GetLastCommittedURL(); |
+ |
+ std::unique_ptr<base::Value> general_setting = |
+ host_content_settings_map->GetWebsiteSetting( |
+ page_url, page_url, CONTENT_SETTINGS_TYPE_PLUGINS, std::string(), |
+ nullptr); |
+ ContentSetting plugin_setting = |
+ content_settings::ValueToContentSetting(general_setting.get()); |
+ plugin_setting = PluginsFieldTrial::EffectiveContentSetting( |
+ CONTENT_SETTINGS_TYPE_PLUGINS, plugin_setting); |
+ |
+ if (plugin_setting != CONTENT_SETTING_DETECT_IMPORTANT_CONTENT) |
+ return nullptr; |
+ |
return base::MakeUnique<navigation_interception::InterceptNavigationThrottle>( |
handle, base::Bind(&ShouldInterceptNavigation), true); |
} |