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_DRIVE_OPERATIONS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_DRIVE_OPERATIONS_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_DRIVE_OPERATIONS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_DRIVE_OPERATIONS_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/sequenced_task_runner.h" | 9 #include "base/sequenced_task_runner.h" |
10 #include "chrome/browser/chromeos/drive/drive_resource_metadata.h" | 10 #include "chrome/browser/chromeos/drive/drive_resource_metadata.h" |
11 | 11 |
| 12 namespace base { |
12 class FilePath; | 13 class FilePath; |
| 14 } |
13 | 15 |
14 namespace google_apis { | 16 namespace google_apis { |
15 class DriveUploaderInterface; | 17 class DriveUploaderInterface; |
16 } | 18 } |
17 | 19 |
18 namespace drive { | 20 namespace drive { |
19 | 21 |
20 class DriveCache; | 22 class DriveCache; |
21 class DriveFileSystemInterface; | 23 class DriveFileSystemInterface; |
22 class DriveScheduler; | 24 class DriveScheduler; |
(...skipping 22 matching lines...) Expand all Loading... |
45 OperationObserver* observer); | 47 OperationObserver* observer); |
46 | 48 |
47 // Initializes the operation pointers. For testing only. | 49 // Initializes the operation pointers. For testing only. |
48 void InitForTesting(CopyOperation* copy_operation, | 50 void InitForTesting(CopyOperation* copy_operation, |
49 MoveOperation* move_operation, | 51 MoveOperation* move_operation, |
50 RemoveOperation* remove_operation, | 52 RemoveOperation* remove_operation, |
51 UpdateOperation* update_operation); | 53 UpdateOperation* update_operation); |
52 | 54 |
53 // Wrapper function for copy_operation_. | 55 // Wrapper function for copy_operation_. |
54 // |callback| must not be null. | 56 // |callback| must not be null. |
55 void Copy(const FilePath& src_file_path, | 57 void Copy(const base::FilePath& src_file_path, |
56 const FilePath& dest_file_path, | 58 const base::FilePath& dest_file_path, |
57 const FileOperationCallback& callback); | 59 const FileOperationCallback& callback); |
58 | 60 |
59 // Wrapper function for copy_operation_. | 61 // Wrapper function for copy_operation_. |
60 // |callback| must not be null. | 62 // |callback| must not be null. |
61 void TransferFileFromRemoteToLocal(const FilePath& remote_src_file_path, | 63 void TransferFileFromRemoteToLocal(const base::FilePath& remote_src_file_path, |
62 const FilePath& local_dest_file_path, | 64 const base::FilePath& local_dest_file_path, |
63 const FileOperationCallback& callback); | 65 const FileOperationCallback& callback); |
64 | 66 |
65 // Wrapper function for copy_operation_. | 67 // Wrapper function for copy_operation_. |
66 // |callback| must not be null. | 68 // |callback| must not be null. |
67 void TransferFileFromLocalToRemote(const FilePath& local_src_file_path, | 69 void TransferFileFromLocalToRemote( |
68 const FilePath& remote_dest_file_path, | 70 const base::FilePath& local_src_file_path, |
69 const FileOperationCallback& callback); | 71 const base::FilePath& remote_dest_file_path, |
| 72 const FileOperationCallback& callback); |
70 | 73 |
71 // Wrapper function for copy_operation_. | 74 // Wrapper function for copy_operation_. |
72 // |callback| must not be null. | 75 // |callback| must not be null. |
73 void TransferRegularFile(const FilePath& local_src_file_path, | 76 void TransferRegularFile(const base::FilePath& local_src_file_path, |
74 const FilePath& remote_dest_file_path, | 77 const base::FilePath& remote_dest_file_path, |
75 const FileOperationCallback& callback); | 78 const FileOperationCallback& callback); |
76 | 79 |
77 // Wrapper function for move_operation_. | 80 // Wrapper function for move_operation_. |
78 // |callback| must not be null. | 81 // |callback| must not be null. |
79 void Move(const FilePath& src_file_path, | 82 void Move(const base::FilePath& src_file_path, |
80 const FilePath& dest_file_path, | 83 const base::FilePath& dest_file_path, |
81 const FileOperationCallback& callback); | 84 const FileOperationCallback& callback); |
82 | 85 |
83 // Wrapper function for remove_operation_. | 86 // Wrapper function for remove_operation_. |
84 // |callback| must not be null. | 87 // |callback| must not be null. |
85 void Remove(const FilePath& file_path, | 88 void Remove(const base::FilePath& file_path, |
86 bool is_recursive, | 89 bool is_recursive, |
87 const FileOperationCallback& callback); | 90 const FileOperationCallback& callback); |
88 | 91 |
89 // Wrapper function for update_operation_. | 92 // Wrapper function for update_operation_. |
90 // |callback| must not be null. | 93 // |callback| must not be null. |
91 void UpdateFileByResourceId(const std::string& resource_id, | 94 void UpdateFileByResourceId(const std::string& resource_id, |
92 const FileOperationCallback& callback); | 95 const FileOperationCallback& callback); |
93 | 96 |
94 private: | 97 private: |
95 scoped_ptr<CopyOperation> copy_operation_; | 98 scoped_ptr<CopyOperation> copy_operation_; |
96 scoped_ptr<MoveOperation> move_operation_; | 99 scoped_ptr<MoveOperation> move_operation_; |
97 scoped_ptr<RemoveOperation> remove_operation_; | 100 scoped_ptr<RemoveOperation> remove_operation_; |
98 scoped_ptr<UpdateOperation> update_operation_; | 101 scoped_ptr<UpdateOperation> update_operation_; |
99 }; | 102 }; |
100 | 103 |
101 } // namespace file_system | 104 } // namespace file_system |
102 } // namespace drive | 105 } // namespace drive |
103 | 106 |
104 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_DRIVE_OPERATIONS_H_ | 107 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_DRIVE_OPERATIONS_H_ |
OLD | NEW |