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/extensions/extension_service.h" | |
9 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" | 9 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
11 #include "chrome/browser/sync/test/integration/sync_test.h" | 10 #include "chrome/browser/sync/test/integration/sync_test.h" |
12 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" | 11 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
13 #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" |
14 #include "chrome/common/extensions/sync_helper.h" | 13 #include "chrome/common/extensions/sync_helper.h" |
| 14 #include "extensions/browser/app_sorting.h" |
15 #include "extensions/browser/extension_system.h" | 15 #include "extensions/browser/extension_system.h" |
16 #include "ui/app_list/app_list_folder_item.h" | 16 #include "ui/app_list/app_list_folder_item.h" |
17 #include "ui/app_list/app_list_item.h" | 17 #include "ui/app_list/app_list_item.h" |
18 #include "ui/app_list/app_list_model.h" | 18 #include "ui/app_list/app_list_model.h" |
19 | 19 |
20 using app_list::AppListFolderItem; | 20 using app_list::AppListFolderItem; |
21 using app_list::AppListItem; | 21 using app_list::AppListItem; |
22 using app_list::AppListItemList; | 22 using app_list::AppListItemList; |
23 using app_list::AppListSyncableService; | 23 using app_list::AppListSyncableService; |
24 using app_list::AppListSyncableServiceFactory; | 24 using app_list::AppListSyncableServiceFactory; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 std::string label = | 163 std::string label = |
164 base::StringPrintf("Item(%d): ", static_cast<int>(i)); | 164 base::StringPrintf("Item(%d): ", static_cast<int>(i)); |
165 PrintItem(profile, item, label); | 165 PrintItem(profile, item, label); |
166 } | 166 } |
167 } | 167 } |
168 | 168 |
169 void SyncAppListHelper::PrintItem(Profile* profile, | 169 void SyncAppListHelper::PrintItem(Profile* profile, |
170 AppListItem* item, | 170 AppListItem* item, |
171 const std::string& label) { | 171 const std::string& label) { |
172 extensions::AppSorting* s = | 172 extensions::AppSorting* s = |
173 extensions::ExtensionSystem::Get(profile)->extension_service()-> | 173 extensions::ExtensionPrefs::Get(profile)->app_sorting(); |
174 extension_prefs()->app_sorting(); | |
175 std::string id = item->id(); | 174 std::string id = item->id(); |
176 if (item->GetItemType() == AppListFolderItem::kItemType) { | 175 if (item->GetItemType() == AppListFolderItem::kItemType) { |
177 VLOG(1) << label << item->ToDebugString(); | 176 VLOG(1) << label << item->ToDebugString(); |
178 AppListFolderItem* folder = static_cast<AppListFolderItem*>(item); | 177 AppListFolderItem* folder = static_cast<AppListFolderItem*>(item); |
179 for (size_t i = 0; i < folder->item_list()->item_count(); ++i) { | 178 for (size_t i = 0; i < folder->item_list()->item_count(); ++i) { |
180 AppListItem* child = folder->item_list()->item_at(i); | 179 AppListItem* child = folder->item_list()->item_at(i); |
181 std::string child_label = | 180 std::string child_label = |
182 base::StringPrintf(" Folder Item(%d): ", static_cast<int>(i)); | 181 base::StringPrintf(" Folder Item(%d): ", static_cast<int>(i)); |
183 PrintItem(profile, child, child_label); | 182 PrintItem(profile, child, child_label); |
184 } | 183 } |
185 return; | 184 return; |
186 } | 185 } |
187 VLOG(1) | 186 VLOG(1) |
188 << label << item->ToDebugString() | 187 << label << item->ToDebugString() |
189 << " Page: " << s->GetPageOrdinal(id).ToDebugString().substr(0, 8) | 188 << " Page: " << s->GetPageOrdinal(id).ToDebugString().substr(0, 8) |
190 << " Item: " << s->GetAppLaunchOrdinal(id).ToDebugString().substr(0, 8); | 189 << " Item: " << s->GetAppLaunchOrdinal(id).ToDebugString().substr(0, 8); |
191 } | 190 } |
OLD | NEW |