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_file_system/drive_backend/metadata_database.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <stack> | 8 #include <stack> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1736 dict->SetString("title", details.title()); | 1736 dict->SetString("title", details.title()); |
1737 dict->SetString("type", FileKindToString(details.file_kind())); | 1737 dict->SetString("type", FileKindToString(details.file_kind())); |
1738 dict->SetString("md5", details.md5()); | 1738 dict->SetString("md5", details.md5()); |
1739 dict->SetString("etag", details.etag()); | 1739 dict->SetString("etag", details.etag()); |
1740 dict->SetString("missing", details.missing() ? "true" : "false"); | 1740 dict->SetString("missing", details.missing() ? "true" : "false"); |
1741 dict->SetString("change_id", base::Int64ToString(details.change_id())); | 1741 dict->SetString("change_id", base::Int64ToString(details.change_id())); |
1742 | 1742 |
1743 std::vector<std::string> parents; | 1743 std::vector<std::string> parents; |
1744 for (int i = 0; i < details.parent_folder_ids_size(); ++i) | 1744 for (int i = 0; i < details.parent_folder_ids_size(); ++i) |
1745 parents.push_back(details.parent_folder_ids(i)); | 1745 parents.push_back(details.parent_folder_ids(i)); |
1746 dict->SetString("parents", JoinString(parents, ",")); | 1746 dict->SetString("parents", base::JoinString(parents, ",")); |
1747 } | 1747 } |
1748 files->Append(dict); | 1748 files->Append(dict); |
1749 } | 1749 } |
1750 return files.Pass(); | 1750 return files.Pass(); |
1751 } | 1751 } |
1752 | 1752 |
1753 void MetadataDatabase::AttachSyncRoot( | 1753 void MetadataDatabase::AttachSyncRoot( |
1754 const google_apis::FileResource& sync_root_folder) { | 1754 const google_apis::FileResource& sync_root_folder) { |
1755 scoped_ptr<FileMetadata> sync_root_metadata = | 1755 scoped_ptr<FileMetadata> sync_root_metadata = |
1756 CreateFileMetadataFromFileResource( | 1756 CreateFileMetadataFromFileResource( |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1801 return false; | 1801 return false; |
1802 | 1802 |
1803 if (!parents.empty()) | 1803 if (!parents.empty()) |
1804 return false; | 1804 return false; |
1805 | 1805 |
1806 return true; | 1806 return true; |
1807 } | 1807 } |
1808 | 1808 |
1809 } // namespace drive_backend | 1809 } // namespace drive_backend |
1810 } // namespace sync_file_system | 1810 } // namespace sync_file_system |
OLD | NEW |