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

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: rebase, more fix 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/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 0212257468d1e8f6870e3d71511f0ddeb430d3c5..02ac0854827706237ce6abf66959c86fdfd87da9 100644
--- a/chrome/browser/extensions/standard_management_policy_provider.cc
+++ b/chrome/browser/extensions/standard_management_policy_provider.cc
@@ -132,4 +132,24 @@ bool StandardManagementPolicyProvider::MustRemainEnabled(
ExternalComponentLoader::IsModifiable(extension));
}
+bool StandardManagementPolicyProvider::MustRemainInstalled(
+ const Extension* extension,
+ base::string16* error) const {
+ ExtensionManagement::InstallationMode mode =
+ settings_->GetInstallationMode(extension->id());
+ // Disallow 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
« no previous file with comments | « chrome/browser/extensions/standard_management_policy_provider.h ('k') | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698