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

Unified Diff: chrome/browser/ui/webui/extensions/extension_settings_handler.cc

Issue 536753003: Add recommended extension installation support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ext-3
Patch Set: rebase Created 6 years, 2 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/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 ec898a88135771bbd1d0284150b77274d1699e21..da63609edee97789e37233b87ea49f03cbf3220f 100644
--- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
+++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
@@ -238,8 +238,13 @@ base::DictionaryValue* ExtensionSettingsHandler::CreateExtensionDetailValue(
!management_policy_->UserMayModifySettings(extension, NULL);
extension_data->SetBoolean("managedInstall", managed_install);
+ bool recommended_install =
+ !managed_install &&
+ management_policy_->MustRemainInstalled(extension, NULL);
+ extension_data->SetBoolean("recommendedInstall", recommended_install);
+
// We should not get into a state where both are true.
Finnur 2014/10/06 14:01:42 Nit: This comment is now out of date. Perhaps: //
binjin 2014/10/06 18:48:47 Done.
- DCHECK(!managed_install || !suspicious_install);
+ DCHECK(!(managed_install || recommended_install) || !suspicious_install);
GURL icon =
ExtensionIconSource::GetIconURL(extension,
@@ -313,7 +318,9 @@ base::DictionaryValue* ExtensionSettingsHandler::CreateExtensionDetailValue(
extension_service_->GetBrowserContext()));
base::string16 location_text;
- if (Manifest::IsPolicyLocation(extension->location())) {
+ if (Manifest::IsPolicyLocation(extension->location()) ||
+ (extension->location() == Manifest::EXTERNAL_PREF_DOWNLOAD &&
+ recommended_install)) {
location_text = l10n_util::GetStringUTF16(
IDS_OPTIONS_INSTALL_LOCATION_ENTERPRISE);
} else if (extension->location() == Manifest::INTERNAL &&
@@ -532,6 +539,8 @@ void ExtensionSettingsHandler::GetLocalizedValues(
l10n_util::GetStringUTF16(IDS_EXTENSIONS_VISIT_WEBSTORE));
source->AddString("extensionSettingsPolicyControlled",
l10n_util::GetStringUTF16(IDS_EXTENSIONS_POLICY_CONTROLLED));
+ source->AddString("extensionSettingsPolicyRecommeneded",
+ l10n_util::GetStringUTF16(IDS_EXTENSIONS_POLICY_RECOMMENDED));
source->AddString("extensionSettingsDependentExtensions",
l10n_util::GetStringUTF16(IDS_EXTENSIONS_DEPENDENT_EXTENSIONS));
source->AddString("extensionSettingsSupervisedUser",

Powered by Google App Engine
This is Rietveld 408576698