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

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: add ui changes Created 6 years, 3 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 20e6b3fc28c78ee2ae84cc5f6392652a0eedeb38..8895423be065e2bb32f632308063d32e1ba2cd8a 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);
Joao da Silva 2014/09/18 12:21:23 This is conflating logic for different things. It
binjin 2014/09/18 16:25:16 How about management_policy_->UserMayModifySetting
binjin 2014/09/18 17:44:07 Okay, I got what you mean. But I still don't think
Joao da Silva 2014/09/19 07:55:52 The point is that ManagementPolicy has more than o
+ extension_data->SetBoolean("recommendedInstall", recommended_install);
+
// We should not get into a state where both are true.
- DCHECK(!managed_install || !suspicious_install);
+ DCHECK(!(managed_install || recommended_install) || !suspicious_install);
GURL icon =
ExtensionIconSource::GetIconURL(extension,
@@ -310,7 +315,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 &&

Powered by Google App Engine
This is Rietveld 408576698