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

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: update test data 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
« no previous file with comments | « chrome/app/theme/theme_resources.grd ('k') | chrome/browser/resources/extensions/extension_list.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..17048f5f769fec61b31d517dff55d582c19378e9 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->type = developer::CONTROLLER_TYPE_POLICY;
+ info->controlled_info->text =
+ l10n_util::GetStringUTF8(IDS_OPTIONS_INSTALL_LOCATION_ENTERPRISE);
+ } else if (profile->IsChild()) {
+ info->controlled_info->type = developer::CONTROLLER_TYPE_CHILD_CUSTODIAN;
+ info->controlled_info->text = l10n_util::GetStringUTF8(
+ IDS_EXTENSIONS_INSTALLED_BY_CHILD_CUSTODIAN);
+ } else {
+ info->controlled_info->type =
+ developer::CONTROLLER_TYPE_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() &&
« no previous file with comments | « chrome/app/theme/theme_resources.grd ('k') | chrome/browser/resources/extensions/extension_list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698