OLD | NEW |
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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 id == extension_misc::kWebStoreAppId) | 109 id == extension_misc::kWebStoreAppId) |
110 return true; | 110 return true; |
111 #if defined(OS_CHROMEOS) | 111 #if defined(OS_CHROMEOS) |
112 if (id == file_manager::kFileManagerAppId || id == genius_app::kGeniusAppId) | 112 if (id == file_manager::kFileManagerAppId || id == genius_app::kGeniusAppId) |
113 return true; | 113 return true; |
114 #endif | 114 #endif |
115 return false; | 115 return false; |
116 } | 116 } |
117 | 117 |
118 void UninstallExtension(ExtensionService* service, const std::string& id) { | 118 void UninstallExtension(ExtensionService* service, const std::string& id) { |
119 if (service && service->GetInstalledExtension(id)) | 119 const extensions::Extension* extension = |
120 service->UninstallExtension( | 120 service ? service->GetInstalledExtension(id) : NULL; |
121 id, ExtensionService::UNINSTALL_REASON_SYNC, NULL); | 121 if (extension) { |
| 122 ExtensionService::UninstallReason reason = |
| 123 extension->was_installed_by_custodian() ? |
| 124 ExtensionService::UNINSTALL_REASON_SYNC_BY_CUSTODIAN : |
| 125 ExtensionService::UNINSTALL_REASON_SYNC; |
| 126 service->UninstallExtension(id, reason, NULL); |
| 127 } |
122 } | 128 } |
123 | 129 |
124 bool GetAppListItemType(AppListItem* item, | 130 bool GetAppListItemType(AppListItem* item, |
125 sync_pb::AppListSpecifics::AppListItemType* type) { | 131 sync_pb::AppListSpecifics::AppListItemType* type) { |
126 const char* item_type = item->GetItemType(); | 132 const char* item_type = item->GetItemType(); |
127 if (item_type == ExtensionAppItem::kItemType) { | 133 if (item_type == ExtensionAppItem::kItemType) { |
128 *type = sync_pb::AppListSpecifics::TYPE_APP; | 134 *type = sync_pb::AppListSpecifics::TYPE_APP; |
129 } else if (item_type == AppListFolderItem::kItemType) { | 135 } else if (item_type == AppListFolderItem::kItemType) { |
130 *type = sync_pb::AppListSpecifics::TYPE_FOLDER; | 136 *type = sync_pb::AppListSpecifics::TYPE_FOLDER; |
131 } else { | 137 } else { |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 } else { | 923 } else { |
918 res += " { " + item_name + " }"; | 924 res += " { " + item_name + " }"; |
919 res += " [" + item_ordinal.ToDebugString() + "]"; | 925 res += " [" + item_ordinal.ToDebugString() + "]"; |
920 if (!parent_id.empty()) | 926 if (!parent_id.empty()) |
921 res += " <" + parent_id.substr(0, 8) + ">"; | 927 res += " <" + parent_id.substr(0, 8) + ">"; |
922 } | 928 } |
923 return res; | 929 return res; |
924 } | 930 } |
925 | 931 |
926 } // namespace app_list | 932 } // namespace app_list |
OLD | NEW |