Chromium Code Reviews| 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/sync/test/integration/sync_app_list_helper.h" | 5 #include "chrome/browser/sync/test/integration/sync_app_list_helper.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" | 9 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
| 10 #include "chrome/browser/sync/test/integration/sync_test.h" | 10 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 11 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" | 11 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
| 12 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" | 12 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" |
| 13 #include "chrome/common/extensions/sync_helper.h" | 13 #include "chrome/common/extensions/sync_helper.h" |
| 14 #include "extensions/browser/app_sorting.h" | 14 #include "extensions/browser/app_sorting.h" |
| 15 #include "extensions/browser/extension_prefs.h" | 15 #include "extensions/browser/extension_prefs.h" |
|
benwells
2015/11/06 01:04:37
nit: Is this include still needed?
Deepak
2015/11/06 06:13:47
Done.
| |
| 16 #include "extensions/browser/extension_system.h" | 16 #include "extensions/browser/extension_system.h" |
| 17 #include "ui/app_list/app_list_folder_item.h" | 17 #include "ui/app_list/app_list_folder_item.h" |
| 18 #include "ui/app_list/app_list_item.h" | 18 #include "ui/app_list/app_list_item.h" |
| 19 #include "ui/app_list/app_list_model.h" | 19 #include "ui/app_list/app_list_model.h" |
| 20 | 20 |
| 21 using app_list::AppListFolderItem; | 21 using app_list::AppListFolderItem; |
| 22 using app_list::AppListItem; | 22 using app_list::AppListItem; |
| 23 using app_list::AppListItemList; | 23 using app_list::AppListItemList; |
| 24 using app_list::AppListSyncableService; | 24 using app_list::AppListSyncableService; |
| 25 using app_list::AppListSyncableServiceFactory; | 25 using app_list::AppListSyncableServiceFactory; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 AppListItem* item = service->GetModel()->top_level_item_list()->item_at(i); | 166 AppListItem* item = service->GetModel()->top_level_item_list()->item_at(i); |
| 167 std::string label = base::StringPrintf("Item(%d): ", static_cast<int>(i)); | 167 std::string label = base::StringPrintf("Item(%d): ", static_cast<int>(i)); |
| 168 PrintItem(profile, item, label); | 168 PrintItem(profile, item, label); |
| 169 } | 169 } |
| 170 } | 170 } |
| 171 | 171 |
| 172 void SyncAppListHelper::PrintItem(Profile* profile, | 172 void SyncAppListHelper::PrintItem(Profile* profile, |
| 173 AppListItem* item, | 173 AppListItem* item, |
| 174 const std::string& label) { | 174 const std::string& label) { |
| 175 extensions::AppSorting* s = | 175 extensions::AppSorting* s = |
| 176 extensions::ExtensionPrefs::Get(profile)->app_sorting(); | 176 extensions::ExtensionSystem::Get(profile)->app_sorting(); |
| 177 std::string id = item->id(); | 177 std::string id = item->id(); |
| 178 if (item->GetItemType() == AppListFolderItem::kItemType) { | 178 if (item->GetItemType() == AppListFolderItem::kItemType) { |
| 179 DVLOG(1) << label << item->ToDebugString(); | 179 DVLOG(1) << label << item->ToDebugString(); |
| 180 AppListFolderItem* folder = static_cast<AppListFolderItem*>(item); | 180 AppListFolderItem* folder = static_cast<AppListFolderItem*>(item); |
| 181 for (size_t i = 0; i < folder->item_list()->item_count(); ++i) { | 181 for (size_t i = 0; i < folder->item_list()->item_count(); ++i) { |
| 182 AppListItem* child = folder->item_list()->item_at(i); | 182 AppListItem* child = folder->item_list()->item_at(i); |
| 183 std::string child_label = | 183 std::string child_label = |
| 184 base::StringPrintf(" Folder Item(%d): ", static_cast<int>(i)); | 184 base::StringPrintf(" Folder Item(%d): ", static_cast<int>(i)); |
| 185 PrintItem(profile, child, child_label); | 185 PrintItem(profile, child, child_label); |
| 186 } | 186 } |
| 187 return; | 187 return; |
| 188 } | 188 } |
| 189 DVLOG(1) << label << item->ToDebugString() | 189 DVLOG(1) << label << item->ToDebugString() |
| 190 << " Page: " << s->GetPageOrdinal(id).ToDebugString().substr(0, 8) | 190 << " Page: " << s->GetPageOrdinal(id).ToDebugString().substr(0, 8) |
| 191 << " Item: " | 191 << " Item: " |
| 192 << s->GetAppLaunchOrdinal(id).ToDebugString().substr(0, 8); | 192 << s->GetAppLaunchOrdinal(id).ToDebugString().substr(0, 8); |
| 193 } | 193 } |
| OLD | NEW |