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_MEDIA_GALLERIES_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_H_ |
6 #define CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 net::IOBuffer* buf, int64 offset, int buf_len, | 141 net::IOBuffer* buf, int64 offset, int buf_len, |
142 const ReadBytesSuccessCallback& success_callback, | 142 const ReadBytesSuccessCallback& success_callback, |
143 const ErrorCallback& error_callback); | 143 const ErrorCallback& error_callback); |
144 virtual void MoveFileLocalInternal( | 144 virtual void MoveFileLocalInternal( |
145 const base::FilePath& source_file_path, | 145 const base::FilePath& source_file_path, |
146 const base::FilePath& device_file_path, | 146 const base::FilePath& device_file_path, |
147 const CreateTemporaryFileCallback& create_temporary_file_callback, | 147 const CreateTemporaryFileCallback& create_temporary_file_callback, |
148 const MoveFileLocalSuccessCallback& success_callback, | 148 const MoveFileLocalSuccessCallback& success_callback, |
149 const ErrorCallback& error_callback, | 149 const ErrorCallback& error_callback, |
150 const base::File::Info& source_file_info); | 150 const base::File::Info& source_file_info); |
151 virtual void CopyFileFromLocalInternal( | 151 virtual void OnDidOpenFDToCopyFileFromLocal( |
152 const base::FilePath& device_file_path, | 152 const base::FilePath& device_file_path, |
153 const CopyFileFromLocalSuccessCallback& success_callback, | 153 const CopyFileFromLocalSuccessCallback& success_callback, |
154 const ErrorCallback& error_callback, | 154 const ErrorCallback& error_callback, |
155 const int source_file_descriptor); | 155 const std::pair<int, int>& open_fd_result); |
156 virtual void DeleteFileInternal( | 156 virtual void DeleteFileInternal( |
157 const base::FilePath& file_path, | 157 const base::FilePath& file_path, |
158 const DeleteFileSuccessCallback& success_callback, | 158 const DeleteFileSuccessCallback& success_callback, |
159 const ErrorCallback& error_callback, | 159 const ErrorCallback& error_callback, |
160 const base::File::Info& file_info); | 160 const base::File::Info& file_info); |
161 virtual void DeleteDirectoryInternal( | 161 virtual void DeleteDirectoryInternal( |
162 const base::FilePath& file_path, | 162 const base::FilePath& file_path, |
163 const DeleteDirectorySuccessCallback& success_callback, | 163 const DeleteDirectorySuccessCallback& success_callback, |
164 const ErrorCallback& error_callback, | 164 const ErrorCallback& error_callback, |
165 const base::File::Info& file_info); | 165 const base::File::Info& file_info); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 // Called when GetFileInfo() succeeds. GetFileInfo() is invoked to | 235 // Called when GetFileInfo() succeeds. GetFileInfo() is invoked to |
236 // create the snapshot file of |snapshot_request_info.device_file_path|. | 236 // create the snapshot file of |snapshot_request_info.device_file_path|. |
237 // |file_info| specifies the device file metadata details. | 237 // |file_info| specifies the device file metadata details. |
238 // | 238 // |
239 // Posts a task on the UI thread to copy the data contents of the device file | 239 // Posts a task on the UI thread to copy the data contents of the device file |
240 // to the snapshot file. | 240 // to the snapshot file. |
241 void OnDidGetFileInfoToCreateSnapshotFile( | 241 void OnDidGetFileInfoToCreateSnapshotFile( |
242 scoped_ptr<SnapshotRequestInfo> snapshot_request_info, | 242 scoped_ptr<SnapshotRequestInfo> snapshot_request_info, |
243 const base::File::Info& file_info); | 243 const base::File::Info& file_info); |
244 | 244 |
| 245 // Called when GetFileInfo() succeeded to copy file from local. |
| 246 void OnDidGetFileInfoToCopyFileFromLocal(const ErrorCallback& error_callback, |
| 247 const base::File::Info& file_info); |
| 248 |
| 249 // Called when GetFileInfo() failed to copy file from local. |
| 250 void OnGetFileInfoErrorToCopyFileFromLocal( |
| 251 const base::FilePath& source_file_path, |
| 252 const base::FilePath& device_file_path, |
| 253 const CopyFileFromLocalSuccessCallback& success_callback, |
| 254 const ErrorCallback& error_callback, |
| 255 const base::File::Error error); |
| 256 |
245 // Called when ReadDirectory() succeeds. | 257 // Called when ReadDirectory() succeeds. |
246 // | 258 // |
247 // |dir_id| is the directory read. | 259 // |dir_id| is the directory read. |
248 // |success_callback| is invoked to notify the caller about the directory | 260 // |success_callback| is invoked to notify the caller about the directory |
249 // file entries. | 261 // file entries. |
250 // |file_list| contains the directory file entries with their file ids. | 262 // |file_list| contains the directory file entries with their file ids. |
251 // |has_more| is true if there are more file entries to read. | 263 // |has_more| is true if there are more file entries to read. |
252 void OnDidReadDirectory(uint32 dir_id, | 264 void OnDidReadDirectory(uint32 dir_id, |
253 const ReadDirectorySuccessCallback& success_callback, | 265 const ReadDirectorySuccessCallback& success_callback, |
254 const storage::AsyncFileUtil::EntryList& file_list, | 266 const storage::AsyncFileUtil::EntryList& file_list, |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 // the ReadDirectory operation. | 420 // the ReadDirectory operation. |
409 FileInfoCache file_info_cache_; | 421 FileInfoCache file_info_cache_; |
410 | 422 |
411 // For callbacks that may run after destruction. | 423 // For callbacks that may run after destruction. |
412 base::WeakPtrFactory<MTPDeviceDelegateImplLinux> weak_ptr_factory_; | 424 base::WeakPtrFactory<MTPDeviceDelegateImplLinux> weak_ptr_factory_; |
413 | 425 |
414 DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplLinux); | 426 DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplLinux); |
415 }; | 427 }; |
416 | 428 |
417 #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_H
_ | 429 #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_H
_ |
OLD | NEW |