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

Unified Diff: chrome/browser/extensions/extension_service.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/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 899fa2e1e7368b7893ad058acd6501afc49fa610..865540f35b939a2782ea01d38e5a4c3b51d07697 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -680,6 +680,7 @@ bool ExtensionService::UninstallExtension(
// Callers should not send us nonexistent extensions.
CHECK(extension.get());
+ ManagementPolicy* by_policy = system_->management_policy();
// Policy change which triggers an uninstall will always set
// |external_uninstall| to true so this is the only way to uninstall
// managed extensions.
@@ -697,8 +698,8 @@ bool ExtensionService::UninstallExtension(
(reason == extensions::UNINSTALL_REASON_SYNC &&
extension->was_installed_by_custodian());
if (!external_uninstall &&
- !system_->management_policy()->UserMayModifySettings(
- extension.get(), error)) {
+ (!by_policy->UserMayModifySettings(extension.get(), error) ||
+ by_policy->MustRemainInstalled(extension.get(), error))) {
content::NotificationService::current()->Notify(
extensions::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED,
content::Source<Profile>(profile_),
« no previous file with comments | « chrome/browser/extensions/extension_management.cc ('k') | chrome/browser/extensions/external_policy_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698