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

Unified Diff: chrome/browser/extensions/standard_management_policy_provider.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/extensions/standard_management_policy_provider.cc
diff --git a/chrome/browser/extensions/standard_management_policy_provider.cc b/chrome/browser/extensions/standard_management_policy_provider.cc
index f2824064067202e033b9105c9d4e03c45bc816f3..8af4119a1b791ea9413c823ef25dfbeee0ff7e81 100644
--- a/chrome/browser/extensions/standard_management_policy_provider.cc
+++ b/chrome/browser/extensions/standard_management_policy_provider.cc
@@ -141,4 +141,26 @@ bool StandardManagementPolicyProvider::MustRemainEnabled(
ExternalComponentLoader::IsModifiable(extension));
}
+bool StandardManagementPolicyProvider::MustRemainInstalled(
+ const Extension* extension,
+ base::string16* error) const {
+ if (!UserMayModifySettings(extension, error))
+ return false;
Joao da Silva 2014/09/18 12:21:23 Why? Shouldn't this be true?
binjin 2014/09/18 16:25:15 Done.
+ ExtensionManagement::InstallationMode mode =
+ settings_->ReadById(extension->id()).installation_mode;
+ // Disallowing removing of recommended extension, to avoid re-install it
+ // again while policy is reload. But disabling of recommended extension is
+ // allowed.
+ if (mode == ExtensionManagement::INSTALLATION_FORCED ||
+ mode == ExtensionManagement::INSTALLATION_RECOMMENDED) {
+ if (error) {
+ *error = l10n_util::GetStringFUTF16(
+ IDS_EXTENSION_CANT_UNINSTALL_POLICY_REQUIRED,
+ base::UTF8ToUTF16(extension->name()));
+ }
+ return true;
+ }
+ return false;
+}
+
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698