| 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/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/task_runner_util.h" | 10 #include "base/task_runner_util.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // Drive File System doesn't support recursive copy. | 47 // Drive File System doesn't support recursive copy. |
| 48 if (src_entry->file_info().is_directory()) | 48 if (src_entry->file_info().is_directory()) |
| 49 return FILE_ERROR_NOT_A_FILE; | 49 return FILE_ERROR_NOT_A_FILE; |
| 50 | 50 |
| 51 *parent_resource_id = parent_entry.resource_id(); | 51 *parent_resource_id = parent_entry.resource_id(); |
| 52 return FILE_ERROR_OK; | 52 return FILE_ERROR_OK; |
| 53 } | 53 } |
| 54 | 54 |
| 55 int64 GetFileSize(const base::FilePath& file_path) { | 55 int64 GetFileSize(const base::FilePath& file_path) { |
| 56 int64 file_size; | 56 int64 file_size; |
| 57 if (!file_util::GetFileSize(file_path, &file_size)) | 57 if (!base::GetFileSize(file_path, &file_size)) |
| 58 return -1; | 58 return -1; |
| 59 return file_size; | 59 return file_size; |
| 60 } | 60 } |
| 61 | 61 |
| 62 // Stores the copied entry and returns its path. | 62 // Stores the copied entry and returns its path. |
| 63 FileError UpdateLocalStateForServerSideCopy( | 63 FileError UpdateLocalStateForServerSideCopy( |
| 64 internal::ResourceMetadata* metadata, | 64 internal::ResourceMetadata* metadata, |
| 65 scoped_ptr<google_apis::ResourceEntry> resource_entry, | 65 scoped_ptr<google_apis::ResourceEntry> resource_entry, |
| 66 base::FilePath* file_path) { | 66 base::FilePath* file_path) { |
| 67 DCHECK(resource_entry); | 67 DCHECK(resource_entry); |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 } | 588 } |
| 589 | 589 |
| 590 DCHECK_EQ(util::GetDriveMyDriveRootPath().value(), | 590 DCHECK_EQ(util::GetDriveMyDriveRootPath().value(), |
| 591 file_path->DirName().value()) << file_path->value(); | 591 file_path->DirName().value()) << file_path->value(); |
| 592 | 592 |
| 593 move_operation_->Move(*file_path, dest_path, false, callback); | 593 move_operation_->Move(*file_path, dest_path, false, callback); |
| 594 } | 594 } |
| 595 | 595 |
| 596 } // namespace file_system | 596 } // namespace file_system |
| 597 } // namespace drive | 597 } // namespace drive |
| OLD | NEW |