| 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..997db5b9457ba175fdee6a2af145662bc57c894d 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,27 @@ void ExtensionInfoGenerator::CreateExtensionInfoHelper(
|
| new std::string(l10n_util::GetStringUTF8(blacklist_text)));
|
| }
|
|
|
| + Profile* profile = Profile::FromBrowserContext(browser_context_);
|
| +
|
| + bool is_policy_location = Manifest::IsPolicyLocation(extension.location());
|
| + if (is_policy_location || util::IsExtensionSupervised(&extension, profile)) {
|
| + info->controlled_info.reset(new developer::ControlledInfo());
|
| + if (is_policy_location) {
|
| + info->controlled_info->by = developer::CONTROLLED_BY_POLICY;
|
| + info->controlled_info->text =
|
| + l10n_util::GetStringUTF8(IDS_OPTIONS_INSTALL_LOCATION_ENTERPRISE);
|
| + } else if (profile->IsChild()) {
|
| + info->controlled_info->by = developer::CONTROLLED_BY_CHILD_CUSTODIAN;
|
| + info->controlled_info->text = l10n_util::GetStringUTF8(
|
| + IDS_EXTENSIONS_INSTALLED_BY_CHILD_CUSTODIAN);
|
| + } else {
|
| + info->controlled_info->by =
|
| + developer::CONTROLLED_BY_SUPERVISED_USER_CUSTODIAN;
|
| + info->controlled_info->text = l10n_util::GetStringUTF8(
|
| + IDS_EXTENSIONS_INSTALLED_BY_SUPERVISED_USER_CUSTODIAN);
|
| + }
|
| + }
|
| +
|
| // Dependent extensions.
|
| if (extension.is_shared_module()) {
|
| scoped_ptr<ExtensionSet> dependent_extensions =
|
| @@ -302,10 +323,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 +408,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() &&
|
|
|