| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/file_system/copy_operation.h" | 5 #include "chrome/browser/chromeos/drive/file_system/copy_operation.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/task_runner_util.h" | 9 #include "base/task_runner_util.h" |
| 10 #include "chrome/browser/chromeos/drive/drive.pb.h" | 10 #include "chrome/browser/chromeos/drive/drive.pb.h" |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 | 550 |
| 551 scheduler_->CopyResource( | 551 scheduler_->CopyResource( |
| 552 resource_id, parent_resource_id, new_title, last_modified, | 552 resource_id, parent_resource_id, new_title, last_modified, |
| 553 base::Bind(&CopyOperation::UpdateAfterServerSideOperation, | 553 base::Bind(&CopyOperation::UpdateAfterServerSideOperation, |
| 554 weak_ptr_factory_.GetWeakPtr(), | 554 weak_ptr_factory_.GetWeakPtr(), |
| 555 callback)); | 555 callback)); |
| 556 } | 556 } |
| 557 | 557 |
| 558 void CopyOperation::UpdateAfterServerSideOperation( | 558 void CopyOperation::UpdateAfterServerSideOperation( |
| 559 const FileOperationCallback& callback, | 559 const FileOperationCallback& callback, |
| 560 google_apis::GDataErrorCode status, | 560 google_apis::DriveApiErrorCode status, |
| 561 scoped_ptr<google_apis::FileResource> entry) { | 561 scoped_ptr<google_apis::FileResource> entry) { |
| 562 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 562 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 563 DCHECK(!callback.is_null()); | 563 DCHECK(!callback.is_null()); |
| 564 | 564 |
| 565 FileError error = GDataToFileError(status); | 565 FileError error = GDataToFileError(status); |
| 566 if (error != FILE_ERROR_OK) { | 566 if (error != FILE_ERROR_OK) { |
| 567 callback.Run(error); | 567 callback.Run(error); |
| 568 return; | 568 return; |
| 569 } | 569 } |
| 570 | 570 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 delegate_->OnFileChangedByOperation(changed_file); | 669 delegate_->OnFileChangedByOperation(changed_file); |
| 670 // Syncing for copy should be done in background, so pass the BACKGROUND | 670 // Syncing for copy should be done in background, so pass the BACKGROUND |
| 671 // context. See: crbug.com/420278. | 671 // context. See: crbug.com/420278. |
| 672 delegate_->OnEntryUpdatedByOperation(ClientContext(BACKGROUND), *local_id); | 672 delegate_->OnEntryUpdatedByOperation(ClientContext(BACKGROUND), *local_id); |
| 673 } | 673 } |
| 674 callback.Run(error); | 674 callback.Run(error); |
| 675 } | 675 } |
| 676 | 676 |
| 677 } // namespace file_system | 677 } // namespace file_system |
| 678 } // namespace drive | 678 } // namespace drive |
| OLD | NEW |