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

Unified Diff: chrome/browser/ui/webui/plugins/plugins_handler.cc

Issue 2150323003: Disallow user overrides to enterprise policy for plugins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits and owners Created 4 years, 5 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 | « chrome/browser/ui/webui/plugins/plugins_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/plugins/plugins_handler.cc
diff --git a/chrome/browser/ui/webui/plugins/plugins_handler.cc b/chrome/browser/ui/webui/plugins/plugins_handler.cc
index 29c3ebf1e9db8add2e3ebc83a7293adb290e4cf6..4aaa5ebd86a7d89775062ead1e4227d086b3c5ac 100644
--- a/chrome/browser/ui/webui/plugins/plugins_handler.cc
+++ b/chrome/browser/ui/webui/plugins/plugins_handler.cc
@@ -261,13 +261,14 @@ mojo::Array<mojom::PluginDataPtr> PluginsPageHandler::GeneratePluginsData(
plugin_data->always_allowed = false;
plugin_data->trusted = false;
+ plugin_data->policy_click_to_play = GetClickToPlayPolicyEnabled();
if (group_enabled) {
if (plugin_metadata->GetSecurityStatus(*active_plugin) ==
PluginMetadata::SECURITY_STATUS_FULLY_TRUSTED) {
plugin_data->trusted = true;
plugin_data->always_allowed = true;
- } else {
+ } else if (!GetClickToPlayPolicyEnabled()) {
const base::DictionaryValue* whitelist =
profile->GetPrefs()->GetDictionary(
prefs::kContentSettingsPluginWhitelist);
@@ -294,6 +295,16 @@ mojo::Array<mojom::PluginDataPtr> PluginsPageHandler::GeneratePluginsData(
return plugins_data;
}
+bool PluginsPageHandler::GetClickToPlayPolicyEnabled() const {
+ Profile* profile = Profile::FromWebUI(web_ui_);
+ HostContentSettingsMap* map =
+ HostContentSettingsMapFactory::GetForProfile(profile);
+ std::string provider_id;
+ ContentSetting setting = map->GetDefaultContentSetting(
+ CONTENT_SETTINGS_TYPE_PLUGINS, &provider_id);
+ return (setting == CONTENT_SETTING_ASK && provider_id == "policy");
+}
+
mojom::PluginFilePtr PluginsPageHandler::GeneratePluginFile(
const WebPluginInfo& plugin,
const base::string16& group_name,
« no previous file with comments | « chrome/browser/ui/webui/plugins/plugins_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698