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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 specifics); | 93 specifics); |
94 } | 94 } |
95 | 95 |
96 bool AppIsDefault(ExtensionService* service, const std::string& id) { | 96 bool AppIsDefault(ExtensionService* service, const std::string& id) { |
97 return service && extensions::ExtensionPrefs::Get(service->profile()) | 97 return service && extensions::ExtensionPrefs::Get(service->profile()) |
98 ->WasInstalledByDefault(id); | 98 ->WasInstalledByDefault(id); |
99 } | 99 } |
100 | 100 |
101 void UninstallExtension(ExtensionService* service, const std::string& id) { | 101 void UninstallExtension(ExtensionService* service, const std::string& id) { |
102 if (service && service->GetInstalledExtension(id)) | 102 if (service && service->GetInstalledExtension(id)) |
103 service->UninstallExtension(id, false, NULL); | 103 service->UninstallExtension( |
| 104 id, ExtensionService::UNINSTALL_REASON_SYNC, NULL); |
104 } | 105 } |
105 | 106 |
106 bool GetAppListItemType(AppListItem* item, | 107 bool GetAppListItemType(AppListItem* item, |
107 sync_pb::AppListSpecifics::AppListItemType* type) { | 108 sync_pb::AppListSpecifics::AppListItemType* type) { |
108 const char* item_type = item->GetItemType(); | 109 const char* item_type = item->GetItemType(); |
109 if (item_type == ExtensionAppItem::kItemType) { | 110 if (item_type == ExtensionAppItem::kItemType) { |
110 *type = sync_pb::AppListSpecifics::TYPE_APP; | 111 *type = sync_pb::AppListSpecifics::TYPE_APP; |
111 } else if (item_type == AppListFolderItem::kItemType) { | 112 } else if (item_type == AppListFolderItem::kItemType) { |
112 *type = sync_pb::AppListSpecifics::TYPE_FOLDER; | 113 *type = sync_pb::AppListSpecifics::TYPE_FOLDER; |
113 } else { | 114 } else { |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 } else { | 819 } else { |
819 res += " { " + item_name + " }"; | 820 res += " { " + item_name + " }"; |
820 res += " [" + item_ordinal.ToDebugString() + "]"; | 821 res += " [" + item_ordinal.ToDebugString() + "]"; |
821 if (!parent_id.empty()) | 822 if (!parent_id.empty()) |
822 res += " <" + parent_id.substr(0, 8) + ">"; | 823 res += " <" + parent_id.substr(0, 8) + ">"; |
823 } | 824 } |
824 return res; | 825 return res; |
825 } | 826 } |
826 | 827 |
827 } // namespace app_list | 828 } // namespace app_list |
OLD | NEW |