| 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/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 } else if (item_type == AppListFolderItem::kItemType) { | 135 } else if (item_type == AppListFolderItem::kItemType) { |
| 136 *type = sync_pb::AppListSpecifics::TYPE_FOLDER; | 136 *type = sync_pb::AppListSpecifics::TYPE_FOLDER; |
| 137 } else { | 137 } else { |
| 138 LOG(ERROR) << "Unrecognized model type: " << item_type; | 138 LOG(ERROR) << "Unrecognized model type: " << item_type; |
| 139 return false; | 139 return false; |
| 140 } | 140 } |
| 141 return true; | 141 return true; |
| 142 } | 142 } |
| 143 | 143 |
| 144 bool IsDriveAppSyncId(const std::string& sync_id) { | 144 bool IsDriveAppSyncId(const std::string& sync_id) { |
| 145 return base::StartsWithASCII(sync_id, kDriveAppSyncIdPrefix, true); | 145 return base::StartsWith(sync_id, kDriveAppSyncIdPrefix, |
| 146 base::CompareCase::SENSITIVE); |
| 146 } | 147 } |
| 147 | 148 |
| 148 std::string GetDriveAppSyncId(const std::string& drive_app_id) { | 149 std::string GetDriveAppSyncId(const std::string& drive_app_id) { |
| 149 return kDriveAppSyncIdPrefix + drive_app_id; | 150 return kDriveAppSyncIdPrefix + drive_app_id; |
| 150 } | 151 } |
| 151 | 152 |
| 152 std::string GetDriveAppIdFromSyncId(const std::string& sync_id) { | 153 std::string GetDriveAppIdFromSyncId(const std::string& sync_id) { |
| 153 if (!IsDriveAppSyncId(sync_id)) | 154 if (!IsDriveAppSyncId(sync_id)) |
| 154 return std::string(); | 155 return std::string(); |
| 155 return sync_id.substr(strlen(kDriveAppSyncIdPrefix)); | 156 return sync_id.substr(strlen(kDriveAppSyncIdPrefix)); |
| (...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 } else { | 995 } else { |
| 995 res += " { " + item_name + " }"; | 996 res += " { " + item_name + " }"; |
| 996 res += " [" + item_ordinal.ToDebugString() + "]"; | 997 res += " [" + item_ordinal.ToDebugString() + "]"; |
| 997 if (!parent_id.empty()) | 998 if (!parent_id.empty()) |
| 998 res += " <" + parent_id.substr(0, 8) + ">"; | 999 res += " <" + parent_id.substr(0, 8) + ">"; |
| 999 } | 1000 } |
| 1000 return res; | 1001 return res; |
| 1001 } | 1002 } |
| 1002 | 1003 |
| 1003 } // namespace app_list | 1004 } // namespace app_list |
| OLD | NEW |