| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 file.details().modification_time())); | 420 file.details().modification_time())); |
| 421 | 421 |
| 422 return file_resource; | 422 return file_resource; |
| 423 } | 423 } |
| 424 | 424 |
| 425 std::unique_ptr<google_apis::ChangeResource> CreateChangeResourceFromMetadata( | 425 std::unique_ptr<google_apis::ChangeResource> CreateChangeResourceFromMetadata( |
| 426 const FileMetadata& file) { | 426 const FileMetadata& file) { |
| 427 std::unique_ptr<google_apis::ChangeResource> change( | 427 std::unique_ptr<google_apis::ChangeResource> change( |
| 428 new google_apis::ChangeResource); | 428 new google_apis::ChangeResource); |
| 429 change->set_change_id(file.details().change_id()); | 429 change->set_change_id(file.details().change_id()); |
| 430 change->set_type(google_apis::ChangeResource::FILE); |
| 430 change->set_file_id(file.file_id()); | 431 change->set_file_id(file.file_id()); |
| 431 change->set_deleted(file.details().missing()); | 432 change->set_deleted(file.details().missing()); |
| 432 if (change->is_deleted()) | 433 if (change->is_deleted()) |
| 433 return change; | 434 return change; |
| 434 | 435 |
| 435 change->set_file(CreateFileResourceFromMetadata(file)); | 436 change->set_file(CreateFileResourceFromMetadata(file)); |
| 436 return change; | 437 return change; |
| 437 } | 438 } |
| 438 | 439 |
| 439 void ApplyRenameChangeToMetadata(const std::string& new_title, | 440 void ApplyRenameChangeToMetadata(const std::string& new_title, |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 EXPECT_TRUE(file->HasKey("details")); | 1168 EXPECT_TRUE(file->HasKey("details")); |
| 1168 | 1169 |
| 1169 ASSERT_TRUE(files->GetDictionary(1, &file)); | 1170 ASSERT_TRUE(files->GetDictionary(1, &file)); |
| 1170 EXPECT_TRUE(file->GetString("title", &str) && str == "file_0"); | 1171 EXPECT_TRUE(file->GetString("title", &str) && str == "file_0"); |
| 1171 EXPECT_TRUE(file->GetString("type", &str) && str == "file"); | 1172 EXPECT_TRUE(file->GetString("type", &str) && str == "file"); |
| 1172 EXPECT_TRUE(file->HasKey("details")); | 1173 EXPECT_TRUE(file->HasKey("details")); |
| 1173 } | 1174 } |
| 1174 | 1175 |
| 1175 } // namespace drive_backend | 1176 } // namespace drive_backend |
| 1176 } // namespace sync_file_system | 1177 } // namespace sync_file_system |
| OLD | NEW |