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

Unified Diff: chrome/browser/extensions/extension_context_menu_model.cc

Issue 903453002: Policy: check MustRemainInstalled in addition to UserMayModifySettings before offering uninstall (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_context_menu_model.cc
diff --git a/chrome/browser/extensions/extension_context_menu_model.cc b/chrome/browser/extensions/extension_context_menu_model.cc
index 6258a8613f222cd49749403f4027a409624c6992..a54ac2ceab3f0f04b9a406c2052edf6dc00df0bb 100644
--- a/chrome/browser/extensions/extension_context_menu_model.cc
+++ b/chrome/browser/extensions/extension_context_menu_model.cc
@@ -156,8 +156,10 @@ bool ExtensionContextMenuModel::IsCommandIdEnabled(int command_id) const {
extension_action_->HasPopup(SessionTabHelper::IdForTab(web_contents));
} else if (command_id == UNINSTALL) {
// Some extension types can not be uninstalled.
- return extensions::ExtensionSystem::Get(
- profile_)->management_policy()->UserMayModifySettings(extension, NULL);
+ extensions::ManagementPolicy* policy =
+ extensions::ExtensionSystem::Get(profile_)->management_policy();
+ return policy->UserMayModifySettings(extension, nullptr) &&
+ !policy->MustRemainInstalled(extension, nullptr);
}
return true;
}
« no previous file with comments | « no previous file | chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698