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

Side by Side 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: add test 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" 5 #include "chrome/browser/ui/app_list/app_list_syncable_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/apps/drive/drive_app_provider.h" 8 #include "chrome/browser/apps/drive/drive_app_provider.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 id == extension_misc::kWebStoreAppId) 110 id == extension_misc::kWebStoreAppId)
111 return true; 111 return true;
112 #if defined(OS_CHROMEOS) 112 #if defined(OS_CHROMEOS)
113 if (id == file_manager::kFileManagerAppId || id == genius_app::kGeniusAppId) 113 if (id == file_manager::kFileManagerAppId || id == genius_app::kGeniusAppId)
114 return true; 114 return true;
115 #endif 115 #endif
116 return false; 116 return false;
117 } 117 }
118 118
119 void UninstallExtension(ExtensionService* service, const std::string& id) { 119 void UninstallExtension(ExtensionService* service, const std::string& id) {
120 if (service && service->GetInstalledExtension(id)) 120
121 service->UninstallExtension(id, extensions::UNINSTALL_REASON_SYNC, NULL); 121 const extensions::Extension* extension =
122 service ? service->GetInstalledExtension(id) : NULL;
123 if (extension) {
124 extensions::UninstallReason reason =
125 extension->was_installed_by_custodian() ?
126 extensions::UNINSTALL_REASON_SYNC_BY_CUSTODIAN :
127 extensions::UNINSTALL_REASON_SYNC;
128 service->UninstallExtension(id, reason, NULL);
stevenjb 2014/07/22 00:47:58 It seems like this should be automatic, or there s
Marc Treib 2014/07/22 09:30:07 Ack. With the change suggested by kalman, this has
129 }
122 } 130 }
123 131
124 bool GetAppListItemType(AppListItem* item, 132 bool GetAppListItemType(AppListItem* item,
125 sync_pb::AppListSpecifics::AppListItemType* type) { 133 sync_pb::AppListSpecifics::AppListItemType* type) {
126 const char* item_type = item->GetItemType(); 134 const char* item_type = item->GetItemType();
127 if (item_type == ExtensionAppItem::kItemType) { 135 if (item_type == ExtensionAppItem::kItemType) {
128 *type = sync_pb::AppListSpecifics::TYPE_APP; 136 *type = sync_pb::AppListSpecifics::TYPE_APP;
129 } else if (item_type == AppListFolderItem::kItemType) { 137 } else if (item_type == AppListFolderItem::kItemType) {
130 *type = sync_pb::AppListSpecifics::TYPE_FOLDER; 138 *type = sync_pb::AppListSpecifics::TYPE_FOLDER;
131 } else { 139 } else {
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 } else { 925 } else {
918 res += " { " + item_name + " }"; 926 res += " { " + item_name + " }";
919 res += " [" + item_ordinal.ToDebugString() + "]"; 927 res += " [" + item_ordinal.ToDebugString() + "]";
920 if (!parent_id.empty()) 928 if (!parent_id.empty())
921 res += " <" + parent_id.substr(0, 8) + ">"; 929 res += " <" + parent_id.substr(0, 8) + ">";
922 } 930 }
923 return res; 931 return res;
924 } 932 }
925 933
926 } // namespace app_list 934 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_sync_service.cc ('k') | extensions/browser/uninstall_reason.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698