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 "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "chrome/browser/apps/drive/drive_app_provider.h" | 9 #include "chrome/browser/apps/drive/drive_app_provider.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 GetDriveAppIdFromSyncId(item_id)); | 912 GetDriveAppIdFromSyncId(item_id)); |
913 } | 913 } |
914 } | 914 } |
915 } | 915 } |
916 | 916 |
917 std::string AppListSyncableService::FindOrCreateOemFolder() { | 917 std::string AppListSyncableService::FindOrCreateOemFolder() { |
918 AppListFolderItem* oem_folder = model_->FindFolderItem(kOemFolderId); | 918 AppListFolderItem* oem_folder = model_->FindFolderItem(kOemFolderId); |
919 if (!oem_folder) { | 919 if (!oem_folder) { |
920 scoped_ptr<AppListFolderItem> new_folder(new AppListFolderItem( | 920 scoped_ptr<AppListFolderItem> new_folder(new AppListFolderItem( |
921 kOemFolderId, AppListFolderItem::FOLDER_TYPE_OEM)); | 921 kOemFolderId, AppListFolderItem::FOLDER_TYPE_OEM)); |
922 oem_folder = static_cast<AppListFolderItem*>( | 922 oem_folder = |
923 model_->AddItem(new_folder.PassAs<app_list::AppListItem>())); | 923 static_cast<AppListFolderItem*>(model_->AddItem(new_folder.Pass())); |
924 SyncItem* oem_sync_item = FindSyncItem(kOemFolderId); | 924 SyncItem* oem_sync_item = FindSyncItem(kOemFolderId); |
925 if (oem_sync_item) { | 925 if (oem_sync_item) { |
926 VLOG(1) << "Creating OEM folder from existing sync item: " | 926 VLOG(1) << "Creating OEM folder from existing sync item: " |
927 << oem_sync_item->item_ordinal.ToDebugString(); | 927 << oem_sync_item->item_ordinal.ToDebugString(); |
928 model_->SetItemPosition(oem_folder, oem_sync_item->item_ordinal); | 928 model_->SetItemPosition(oem_folder, oem_sync_item->item_ordinal); |
929 } else { | 929 } else { |
930 model_->SetItemPosition(oem_folder, GetOemFolderPos()); | 930 model_->SetItemPosition(oem_folder, GetOemFolderPos()); |
931 // Do not create a sync item for the OEM folder here, do it in | 931 // Do not create a sync item for the OEM folder here, do it in |
932 // ResolveFolderPositions() when the item position is finalized. | 932 // ResolveFolderPositions() when the item position is finalized. |
933 } | 933 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 } else { | 992 } else { |
993 res += " { " + item_name + " }"; | 993 res += " { " + item_name + " }"; |
994 res += " [" + item_ordinal.ToDebugString() + "]"; | 994 res += " [" + item_ordinal.ToDebugString() + "]"; |
995 if (!parent_id.empty()) | 995 if (!parent_id.empty()) |
996 res += " <" + parent_id.substr(0, 8) + ">"; | 996 res += " <" + parent_id.substr(0, 8) + ">"; |
997 } | 997 } |
998 return res; | 998 return res; |
999 } | 999 } |
1000 | 1000 |
1001 } // namespace app_list | 1001 } // namespace app_list |
OLD | NEW |