| 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 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_COPY_OPERATION_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_COPY_OPERATION_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_COPY_OPERATION_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_COPY_OPERATION_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // CopyLocalFileOnBlockingPool to copy |local_file_path| to | 99 // CopyLocalFileOnBlockingPool to copy |local_file_path| to |
| 100 // |local_dest_file_path|. | 100 // |local_dest_file_path|. |
| 101 // | 101 // |
| 102 // Can be called from UI thread. |callback| is run on the calling thread. | 102 // Can be called from UI thread. |callback| is run on the calling thread. |
| 103 // |callback| must not be null. | 103 // |callback| must not be null. |
| 104 void OnGetFileCompleteForTransferFile( | 104 void OnGetFileCompleteForTransferFile( |
| 105 const base::FilePath& local_dest_file_path, | 105 const base::FilePath& local_dest_file_path, |
| 106 const FileOperationCallback& callback, | 106 const FileOperationCallback& callback, |
| 107 FileError error, | 107 FileError error, |
| 108 const base::FilePath& local_file_path, | 108 const base::FilePath& local_file_path, |
| 109 const std::string& unused_mime_type, | 109 scoped_ptr<ResourceEntry> entry); |
| 110 DriveFileType file_type); | |
| 111 | 110 |
| 112 // Copies a hosted document with |resource_id| to the directory at |dir_path| | 111 // Copies a hosted document with |resource_id| to the directory at |dir_path| |
| 113 // and names the copied document as |new_name|. | 112 // and names the copied document as |new_name|. |
| 114 // | 113 // |
| 115 // Can be called from UI thread. |callback| is run on the calling thread. | 114 // Can be called from UI thread. |callback| is run on the calling thread. |
| 116 // |callback| must not be null. | 115 // |callback| must not be null. |
| 117 void CopyHostedDocumentToDirectory(const base::FilePath& dir_path, | 116 void CopyHostedDocumentToDirectory(const base::FilePath& dir_path, |
| 118 const std::string& resource_id, | 117 const std::string& resource_id, |
| 119 const base::FilePath::StringType& new_name, | 118 const base::FilePath::StringType& new_name, |
| 120 const FileOperationCallback& callback); | 119 const FileOperationCallback& callback); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 146 | 145 |
| 147 // Invoked upon completion of GetFileByPath initiated by Copy. If | 146 // Invoked upon completion of GetFileByPath initiated by Copy. If |
| 148 // GetFileByPath reports no error, calls TransferRegularFile to transfer | 147 // GetFileByPath reports no error, calls TransferRegularFile to transfer |
| 149 // |local_file_path| to |remote_dest_file_path|. | 148 // |local_file_path| to |remote_dest_file_path|. |
| 150 // | 149 // |
| 151 // Can be called from UI thread. |callback| is run on the calling thread. | 150 // Can be called from UI thread. |callback| is run on the calling thread. |
| 152 void OnGetFileCompleteForCopy(const base::FilePath& remote_dest_file_path, | 151 void OnGetFileCompleteForCopy(const base::FilePath& remote_dest_file_path, |
| 153 const FileOperationCallback& callback, | 152 const FileOperationCallback& callback, |
| 154 FileError error, | 153 FileError error, |
| 155 const base::FilePath& local_file_path, | 154 const base::FilePath& local_file_path, |
| 156 const std::string& unused_mime_type, | 155 scoped_ptr<ResourceEntry> entry); |
| 157 DriveFileType file_type); | |
| 158 | 156 |
| 159 // Part of TransferFileFromLocalToRemote(). Called after | 157 // Part of TransferFileFromLocalToRemote(). Called after |
| 160 // GetEntryInfoByPath() is complete. | 158 // GetEntryInfoByPath() is complete. |
| 161 void TransferFileFromLocalToRemoteAfterGetEntryInfo( | 159 void TransferFileFromLocalToRemoteAfterGetEntryInfo( |
| 162 const base::FilePath& local_src_file_path, | 160 const base::FilePath& local_src_file_path, |
| 163 const base::FilePath& remote_dest_file_path, | 161 const base::FilePath& remote_dest_file_path, |
| 164 const FileOperationCallback& callback, | 162 const FileOperationCallback& callback, |
| 165 FileError error, | 163 FileError error, |
| 166 scoped_ptr<ResourceEntry> entry); | 164 scoped_ptr<ResourceEntry> entry); |
| 167 | 165 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 196 // invalidate the weak pointers before any other members are destroyed. | 194 // invalidate the weak pointers before any other members are destroyed. |
| 197 base::WeakPtrFactory<CopyOperation> weak_ptr_factory_; | 195 base::WeakPtrFactory<CopyOperation> weak_ptr_factory_; |
| 198 | 196 |
| 199 DISALLOW_COPY_AND_ASSIGN(CopyOperation); | 197 DISALLOW_COPY_AND_ASSIGN(CopyOperation); |
| 200 }; | 198 }; |
| 201 | 199 |
| 202 } // namespace file_system | 200 } // namespace file_system |
| 203 } // namespace drive | 201 } // namespace drive |
| 204 | 202 |
| 205 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_COPY_OPERATION_H_ | 203 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_COPY_OPERATION_H_ |
| OLD | NEW |