| 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/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 specifics); | 92 specifics); |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool AppIsDefault(ExtensionService* service, const std::string& id) { | 95 bool AppIsDefault(ExtensionService* service, const std::string& id) { |
| 96 return service && extensions::ExtensionPrefs::Get(service->profile()) | 96 return service && extensions::ExtensionPrefs::Get(service->profile()) |
| 97 ->WasInstalledByDefault(id); | 97 ->WasInstalledByDefault(id); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void UninstallExtension(ExtensionService* service, const std::string& id) { | 100 void UninstallExtension(ExtensionService* service, const std::string& id) { |
| 101 if (service && service->GetInstalledExtension(id)) | 101 if (service && service->GetInstalledExtension(id)) |
| 102 service->UninstallExtension(id, false, NULL); | 102 service->UninstallExtension( |
| 103 id, ExtensionService::kUninstallReasonSynch, NULL); |
| 103 } | 104 } |
| 104 | 105 |
| 105 bool GetAppListItemType(AppListItem* item, | 106 bool GetAppListItemType(AppListItem* item, |
| 106 sync_pb::AppListSpecifics::AppListItemType* type) { | 107 sync_pb::AppListSpecifics::AppListItemType* type) { |
| 107 const char* item_type = item->GetItemType(); | 108 const char* item_type = item->GetItemType(); |
| 108 if (item_type == ExtensionAppItem::kItemType) { | 109 if (item_type == ExtensionAppItem::kItemType) { |
| 109 *type = sync_pb::AppListSpecifics::TYPE_APP; | 110 *type = sync_pb::AppListSpecifics::TYPE_APP; |
| 110 } else if (item_type == AppListFolderItem::kItemType) { | 111 } else if (item_type == AppListFolderItem::kItemType) { |
| 111 *type = sync_pb::AppListSpecifics::TYPE_FOLDER; | 112 *type = sync_pb::AppListSpecifics::TYPE_FOLDER; |
| 112 } else { | 113 } else { |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 } else { | 806 } else { |
| 806 res += " { " + item_name + " }"; | 807 res += " { " + item_name + " }"; |
| 807 res += " [" + item_ordinal.ToDebugString() + "]"; | 808 res += " [" + item_ordinal.ToDebugString() + "]"; |
| 808 if (!parent_id.empty()) | 809 if (!parent_id.empty()) |
| 809 res += " <" + parent_id.substr(0, 8) + ">"; | 810 res += " <" + parent_id.substr(0, 8) + ">"; |
| 810 } | 811 } |
| 811 return res; | 812 return res; |
| 812 } | 813 } |
| 813 | 814 |
| 814 } // namespace app_list | 815 } // namespace app_list |
| OLD | NEW |