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

Unified Diff: chrome/browser/ui/app_list/app_list_syncable_service.cc

Issue 405433003: Apps&Extensions for supervised users: Allow the custodian to remotely uninstall extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: other UNINSTALL_REASON_SYNC occurrences Created 6 years, 5 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/app_list/app_list_syncable_service.cc
diff --git a/chrome/browser/ui/app_list/app_list_syncable_service.cc b/chrome/browser/ui/app_list/app_list_syncable_service.cc
index 2f0cddaef010e47808f3f79a8c9ae91ce68a3d63..62da816edbbc3098639556c8d6333bee5c8ac12a 100644
--- a/chrome/browser/ui/app_list/app_list_syncable_service.cc
+++ b/chrome/browser/ui/app_list/app_list_syncable_service.cc
@@ -116,9 +116,15 @@ bool IsUnRemovableDefaultApp(const std::string& id) {
}
void UninstallExtension(ExtensionService* service, const std::string& id) {
- if (service && service->GetInstalledExtension(id))
- service->UninstallExtension(
- id, ExtensionService::UNINSTALL_REASON_SYNC, NULL);
+ const extensions::Extension* extension =
+ service ? service->GetInstalledExtension(id) : NULL;
+ if (extension) {
+ ExtensionService::UninstallReason reason =
+ extension->was_installed_by_custodian() ?
+ ExtensionService::UNINSTALL_REASON_SYNC_BY_CUSTODIAN :
+ ExtensionService::UNINSTALL_REASON_SYNC;
+ service->UninstallExtension(id, reason, NULL);
+ }
}
bool GetAppListItemType(AppListItem* item,

Powered by Google App Engine
This is Rietveld 408576698