| 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 9537f617691251091338c3900959b8ecf8a041bb..8e3b041ca765df3aedb0401b3fde71d8ed18d532 100644
|
| --- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
|
| +++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
|
| @@ -272,6 +272,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,
|
| @@ -1077,6 +1083,11 @@ void ExtensionSettingsHandler::HandleEnableMessage(
|
| 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 enable an extension that is "
|
| << "non-usermanagable. Extension id: " << extension->id();
|
| @@ -1161,6 +1172,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 : "
|
|
|