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

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

Issue 2376603002: Add checks that ensure flash isn't exposed to a page if an enterprise ASK setting is in effect (Closed)
Patch Set: Add checks that ensure flash isn't exposed to a page if an enterprise ASK setting is in effect Created 4 years, 3 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/browser/plugins/chrome_plugin_service_filter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugins/chrome_plugin_service_filter.cc
diff --git a/chrome/browser/plugins/chrome_plugin_service_filter.cc b/chrome/browser/plugins/chrome_plugin_service_filter.cc
index a23f51c31ee32ae0fdc0dae0d29abe3a0c85708e..0e8783df8ea58aac46e3e845d72a4d4848df2718 100644
--- a/chrome/browser/plugins/chrome_plugin_service_filter.cc
+++ b/chrome/browser/plugins/chrome_plugin_service_filter.cc
@@ -208,10 +208,11 @@ bool ChromePluginServiceFilter::IsPluginAvailable(
// main frame origin). The intended behavior is that Flash is advertised
// only if a Flash embed hosted on the same origin as the main frame origin
// is allowed to run.
+ bool is_managed = false;
HostContentSettingsMap* settings_map =
context_info_it->second->host_content_settings_map.get();
ContentSetting flash_setting = PluginUtils::GetFlashPluginContentSetting(
- settings_map, main_url, plugin_content_url);
+ settings_map, main_url, plugin_content_url, &is_managed);
flash_setting = PluginsFieldTrial::EffectiveContentSetting(
CONTENT_SETTINGS_TYPE_PLUGINS, flash_setting);
if (flash_setting == CONTENT_SETTING_ALLOW)
@@ -221,8 +222,11 @@ bool ChromePluginServiceFilter::IsPluginAvailable(
// The content setting is neither ALLOW or BLOCK. Check whether the site
// meets the engagement cutoff for making Flash available without a prompt.
- if (SiteEngagementService::GetScoreFromSettings(settings_map, main_url) <
- PluginsFieldTrial::GetSiteEngagementThresholdForFlash()) {
+ // This should only happen if the setting isn't being enforced by an
+ // enterprise policy.
+ if (is_managed ||
+ SiteEngagementService::GetScoreFromSettings(settings_map, main_url) <
+ PluginsFieldTrial::GetSiteEngagementThresholdForFlash()) {
return false;
}
}
« no previous file with comments | « no previous file | chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698