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

Unified Diff: chrome/browser/extensions/api/developer_private/extension_info_generator.cc

Issue 1051273002: Update chrome://extensions for supervised users (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: new icons Created 5 years, 7 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/extensions/api/developer_private/extension_info_generator.cc
diff --git a/chrome/browser/extensions/api/developer_private/extension_info_generator.cc b/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
index 4061e944637c608011f3b0314a13f24a29b9184d..7e047a97657d24bfbc2a2be926ec98b913354c75 100644
--- a/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
+++ b/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
@@ -257,6 +257,24 @@ void ExtensionInfoGenerator::CreateExtensionInfoHelper(
new std::string(l10n_util::GetStringUTF8(blacklist_text)));
}
+ Profile* profile = Profile::FromBrowserContext(browser_context_);
+
+ if (Manifest::IsPolicyLocation(extension.location())) {
+ info->controlled_by.reset(new std::string("policy"));
+ info->controlled_by_text.reset(new std::string(
+ l10n_util::GetStringUTF8(IDS_OPTIONS_INSTALL_LOCATION_ENTERPRISE)));
+ } else if (util::IsExtensionSupervised(&extension, profile)) {
+ if (profile->IsChild()) {
+ info->controlled_by.reset(new std::string("child-custodian"));
+ info->controlled_by_text.reset(new std::string(l10n_util::GetStringUTF8(
+ IDS_EXTENSIONS_INSTALLED_BY_CHILD_CUSTODIAN)));
+ } else {
+ info->controlled_by.reset(new std::string("supervised-user-custodian"));
+ info->controlled_by_text.reset(new std::string(l10n_util::GetStringUTF8(
+ IDS_EXTENSIONS_INSTALLED_BY_SUPERVISED_USER_CUSTODIAN)));
+ }
+ }
+
// Dependent extensions.
if (extension.is_shared_module()) {
scoped_ptr<ExtensionSet> dependent_extensions =
@@ -302,10 +320,6 @@ void ExtensionInfoGenerator::CreateExtensionInfoHelper(
info->incognito_access.is_active =
util::IsIncognitoEnabled(extension.id(), browser_context_);
- Profile* profile = Profile::FromBrowserContext(browser_context_);
- info->installed_by_custodian =
- util::IsExtensionSupervised(&extension, profile);
-
// Install warnings (only if unpacked and no error console).
if (!error_console_enabled &&
Manifest::IsUnpackedLocation(extension.location())) {
@@ -391,11 +405,6 @@ void ExtensionInfoGenerator::CreateExtensionInfoHelper(
extensions::path_util::PrettifyPath(extension.path()).AsUTF8Unsafe()));
}
- if (Manifest::IsPolicyLocation(extension.location())) {
- info->policy_text.reset(new std::string(
- l10n_util::GetStringUTF8(IDS_OPTIONS_INSTALL_LOCATION_ENTERPRISE)));
- }
-
// Runs on all urls.
info->run_on_all_urls.is_enabled =
(FeatureSwitch::scripts_require_action()->IsEnabled() &&

Powered by Google App Engine
This is Rietveld 408576698