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

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: rebase 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
« no previous file with comments | « chrome/browser/ui/extensions/extension_enable_flow.cc ('k') | extensions/browser/management_policy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 64afdb06a641a015f6edfb6be17a9622683da322..7245cdb4c7adf2361ded80ffaef846fcce7650e9 100644
--- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
+++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
@@ -271,6 +271,11 @@ 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() &&
+ util::IsExtensionSupervised(extension, Profile::FromWebUI(web_ui()));
+ extension_data->SetBoolean("installedByCustodian", installed_by_custodian);
+
GURL icon =
ExtensionIconSource::GetIconURL(extension,
extension_misc::EXTENSION_ICON_MEDIUM,
@@ -1113,6 +1118,9 @@ void ExtensionSettingsHandler::HandleAllowFileAccessMessage(
if (!extension)
return;
+ if (util::IsExtensionSupervised(extension, Profile::FromWebUI(web_ui())))
+ 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 : "
« no previous file with comments | « chrome/browser/ui/extensions/extension_enable_flow.cc ('k') | extensions/browser/management_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698