Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: chrome/browser/sync/test/integration/sync_app_list_helper.cc

Issue 1419823011: app_sorting() calls should go via ExtensionSystem intsead of prefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
16 #include "extensions/browser/extension_system.h" 15 #include "extensions/browser/extension_system.h"
17 #include "ui/app_list/app_list_folder_item.h" 16 #include "ui/app_list/app_list_folder_item.h"
18 #include "ui/app_list/app_list_item.h" 17 #include "ui/app_list/app_list_item.h"
19 #include "ui/app_list/app_list_model.h" 18 #include "ui/app_list/app_list_model.h"
20 19
21 using app_list::AppListFolderItem; 20 using app_list::AppListFolderItem;
22 using app_list::AppListItem; 21 using app_list::AppListItem;
23 using app_list::AppListItemList; 22 using app_list::AppListItemList;
24 using app_list::AppListSyncableService; 23 using app_list::AppListSyncableService;
25 using app_list::AppListSyncableServiceFactory; 24 using app_list::AppListSyncableServiceFactory;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 AppListItem* item = service->GetModel()->top_level_item_list()->item_at(i); 165 AppListItem* item = service->GetModel()->top_level_item_list()->item_at(i);
167 std::string label = base::StringPrintf("Item(%d): ", static_cast<int>(i)); 166 std::string label = base::StringPrintf("Item(%d): ", static_cast<int>(i));
168 PrintItem(profile, item, label); 167 PrintItem(profile, item, label);
169 } 168 }
170 } 169 }
171 170
172 void SyncAppListHelper::PrintItem(Profile* profile, 171 void SyncAppListHelper::PrintItem(Profile* profile,
173 AppListItem* item, 172 AppListItem* item,
174 const std::string& label) { 173 const std::string& label) {
175 extensions::AppSorting* s = 174 extensions::AppSorting* s =
176 extensions::ExtensionPrefs::Get(profile)->app_sorting(); 175 extensions::ExtensionSystem::Get(profile)->app_sorting();
177 std::string id = item->id(); 176 std::string id = item->id();
178 if (item->GetItemType() == AppListFolderItem::kItemType) { 177 if (item->GetItemType() == AppListFolderItem::kItemType) {
179 DVLOG(1) << label << item->ToDebugString(); 178 DVLOG(1) << label << item->ToDebugString();
180 AppListFolderItem* folder = static_cast<AppListFolderItem*>(item); 179 AppListFolderItem* folder = static_cast<AppListFolderItem*>(item);
181 for (size_t i = 0; i < folder->item_list()->item_count(); ++i) { 180 for (size_t i = 0; i < folder->item_list()->item_count(); ++i) {
182 AppListItem* child = folder->item_list()->item_at(i); 181 AppListItem* child = folder->item_list()->item_at(i);
183 std::string child_label = 182 std::string child_label =
184 base::StringPrintf(" Folder Item(%d): ", static_cast<int>(i)); 183 base::StringPrintf(" Folder Item(%d): ", static_cast<int>(i));
185 PrintItem(profile, child, child_label); 184 PrintItem(profile, child, child_label);
186 } 185 }
187 return; 186 return;
188 } 187 }
189 DVLOG(1) << label << item->ToDebugString() 188 DVLOG(1) << label << item->ToDebugString()
190 << " Page: " << s->GetPageOrdinal(id).ToDebugString().substr(0, 8) 189 << " Page: " << s->GetPageOrdinal(id).ToDebugString().substr(0, 8)
191 << " Item: " 190 << " Item: "
192 << s->GetAppLaunchOrdinal(id).ToDebugString().substr(0, 8); 191 << s->GetAppLaunchOrdinal(id).ToDebugString().substr(0, 8);
193 } 192 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698