| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "components/drive/chromeos/fake_file_system.h" | 5 #include "components/drive/chromeos/fake_file_system.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 std::unique_ptr<ResourceEntry> parent_entry) { | 380 std::unique_ptr<ResourceEntry> parent_entry) { |
| 381 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 381 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 382 | 382 |
| 383 if (error != FILE_ERROR_OK) { | 383 if (error != FILE_ERROR_OK) { |
| 384 callback.Run(error, std::unique_ptr<ResourceEntry>()); | 384 callback.Run(error, std::unique_ptr<ResourceEntry>()); |
| 385 return; | 385 return; |
| 386 } | 386 } |
| 387 | 387 |
| 388 DCHECK(parent_entry); | 388 DCHECK(parent_entry); |
| 389 drive_service_->GetFileListInDirectory( | 389 drive_service_->GetFileListInDirectory( |
| 390 parent_entry->resource_id(), | 390 parent_entry->resource_id(), "" /* team_drive_id */, |
| 391 base::Bind( | 391 base::Bind(&FakeFileSystem::GetResourceEntryAfterGetFileList, |
| 392 &FakeFileSystem::GetResourceEntryAfterGetFileList, | 392 weak_ptr_factory_.GetWeakPtr(), base_name, callback)); |
| 393 weak_ptr_factory_.GetWeakPtr(), base_name, callback)); | |
| 394 } | 393 } |
| 395 | 394 |
| 396 void FakeFileSystem::GetResourceEntryAfterGetFileList( | 395 void FakeFileSystem::GetResourceEntryAfterGetFileList( |
| 397 const base::FilePath& base_name, | 396 const base::FilePath& base_name, |
| 398 const GetResourceEntryCallback& callback, | 397 const GetResourceEntryCallback& callback, |
| 399 google_apis::DriveApiErrorCode gdata_error, | 398 google_apis::DriveApiErrorCode gdata_error, |
| 400 std::unique_ptr<google_apis::FileList> file_list) { | 399 std::unique_ptr<google_apis::FileList> file_list) { |
| 401 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 400 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 402 | 401 |
| 403 FileError error = GDataToFileError(gdata_error); | 402 FileError error = GDataToFileError(gdata_error); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 422 callback.Run(FILE_ERROR_OK, std::move(entry)); | 421 callback.Run(FILE_ERROR_OK, std::move(entry)); |
| 423 return; | 422 return; |
| 424 } | 423 } |
| 425 } | 424 } |
| 426 | 425 |
| 427 callback.Run(FILE_ERROR_NOT_FOUND, std::unique_ptr<ResourceEntry>()); | 426 callback.Run(FILE_ERROR_NOT_FOUND, std::unique_ptr<ResourceEntry>()); |
| 428 } | 427 } |
| 429 | 428 |
| 430 } // namespace test_util | 429 } // namespace test_util |
| 431 } // namespace drive | 430 } // namespace drive |
| OLD | NEW |