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 "chrome/browser/chromeos/drive/fake_file_system.h" | 5 #include "chrome/browser/chromeos/drive/fake_file_system.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 initialized_callback.Run(FILE_ERROR_OK, entry.Pass(), cache_path, | 335 initialized_callback.Run(FILE_ERROR_OK, entry.Pass(), cache_path, |
336 base::Closure()); | 336 base::Closure()); |
337 completion_callback.Run(FILE_ERROR_OK); | 337 completion_callback.Run(FILE_ERROR_OK); |
338 return; | 338 return; |
339 } | 339 } |
340 | 340 |
341 initialized_callback.Run(FILE_ERROR_OK, entry.Pass(), base::FilePath(), | 341 initialized_callback.Run(FILE_ERROR_OK, entry.Pass(), base::FilePath(), |
342 base::Bind(&base::DoNothing)); | 342 base::Bind(&base::DoNothing)); |
343 drive_service_->DownloadFile( | 343 drive_service_->DownloadFile( |
344 cache_path, | 344 cache_path, |
345 GURL(gdata_entry->download_url()), | 345 gdata_entry->resource_id(), |
346 base::Bind(&FakeFileSystem::GetFileContentByPathAfterDownloadFile, | 346 base::Bind(&FakeFileSystem::GetFileContentByPathAfterDownloadFile, |
347 weak_ptr_factory_.GetWeakPtr(), | 347 weak_ptr_factory_.GetWeakPtr(), |
348 completion_callback), | 348 completion_callback), |
349 get_content_callback, | 349 get_content_callback, |
350 google_apis::ProgressCallback()); | 350 google_apis::ProgressCallback()); |
351 } | 351 } |
352 | 352 |
353 void FakeFileSystem::GetFileContentByPathAfterDownloadFile( | 353 void FakeFileSystem::GetFileContentByPathAfterDownloadFile( |
354 const FileOperationCallback& completion_callback, | 354 const FileOperationCallback& completion_callback, |
355 google_apis::GDataErrorCode gdata_error, | 355 google_apis::GDataErrorCode gdata_error, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 callback.Run(FILE_ERROR_OK, entry.Pass()); | 423 callback.Run(FILE_ERROR_OK, entry.Pass()); |
424 return; | 424 return; |
425 } | 425 } |
426 } | 426 } |
427 | 427 |
428 callback.Run(FILE_ERROR_NOT_FOUND, scoped_ptr<ResourceEntry>()); | 428 callback.Run(FILE_ERROR_NOT_FOUND, scoped_ptr<ResourceEntry>()); |
429 } | 429 } |
430 | 430 |
431 } // namespace test_util | 431 } // namespace test_util |
432 } // namespace drive | 432 } // namespace drive |
OLD | NEW |