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

Unified Diff: chrome/browser/ui/webui/extensions/extension_settings_handler.cc

Issue 925563002: Supervised users: Slightly relax restrictions around extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@test_ext_install_disable
Patch Set: fix Created 5 years, 10 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/ui/webui/extensions/extension_settings_handler.cc
diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
index 74c8a42627b9d5ece0495cdb83ae0703c82c4079..b3a79fbf698aedd54037098badffb8d58b8a1534 100644
--- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
+++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
@@ -276,6 +276,12 @@ base::DictionaryValue* ExtensionSettingsHandler::CreateExtensionDetailValue(
// recommended install.
DCHECK(!(managed_install || recommended_install) || !suspicious_install);
+ // |web_ui()| can be null in unit tests.
+ bool installed_by_custodian =
+ web_ui() && Profile::FromWebUI(web_ui())->IsSupervised() &&
+ extension->was_installed_by_custodian();
+ extension_data->SetBoolean("installedByCustodian", installed_by_custodian);
+
GURL icon =
ExtensionIconSource::GetIconURL(extension,
extension_misc::EXTENSION_ICON_MEDIUM,
@@ -1081,6 +1087,11 @@ void ExtensionSettingsHandler::HandleEnableMessage(
if (!extension)
return;
+ if (Profile::FromWebUI(web_ui())->IsSupervised() &&
+ extension->was_installed_by_custodian()) {
Pam (message me for reviews) 2015/02/23 10:18:50 It really seems like being installed by a custodia
Marc Treib 2015/02/23 12:07:38 As mentioned above: UserMayModifySettings = false
Pam (message me for reviews) 2015/02/23 12:20:17 So that's something we should sort out fairly soon
Marc Treib 2015/02/23 12:33:59 Done.
+ return;
+ }
+
if (!management_policy_->UserMayModifySettings(extension, NULL)) {
LOG(ERROR) << "An attempt was made to enable an extension that is "
<< "non-usermanagable. Extension id: " << extension->id();
@@ -1165,6 +1176,11 @@ void ExtensionSettingsHandler::HandleAllowFileAccessMessage(
if (!extension)
return;
+ if (Profile::FromWebUI(web_ui())->IsSupervised() &&
+ extension->was_installed_by_custodian()) {
+ return;
+ }
+
if (!management_policy_->UserMayModifySettings(extension, NULL)) {
LOG(ERROR) << "An attempt was made to change allow file access of an"
<< " extension that is non-usermanagable. Extension id : "

Powered by Google App Engine
This is Rietveld 408576698