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_OPERATIONS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATIONS_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATIONS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATIONS_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/chromeos/drive/file_system_interface.h" | 9 #include "chrome/browser/chromeos/drive/file_system_interface.h" |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 namespace internal { | 25 namespace internal { |
26 class FileCache; | 26 class FileCache; |
27 class ResourceMetadata; | 27 class ResourceMetadata; |
28 } // namespace internal | 28 } // namespace internal |
29 | 29 |
30 namespace file_system { | 30 namespace file_system { |
31 | 31 |
32 class CopyOperation; | 32 class CopyOperation; |
33 class CreateDirectoryOperation; | 33 class CreateDirectoryOperation; |
34 class CreateFileOperation; | 34 class CreateFileOperation; |
| 35 class DownloadOperation; |
35 class MoveOperation; | 36 class MoveOperation; |
36 class OperationObserver; | 37 class OperationObserver; |
37 class RemoveOperation; | 38 class RemoveOperation; |
38 class SearchOperation; | 39 class SearchOperation; |
39 class TouchOperation; | 40 class TouchOperation; |
40 class UpdateOperation; | 41 class UpdateOperation; |
41 | 42 |
42 // Callback for Operations::Search. | 43 // Callback for Operations::Search. |
43 // On success, |error| is FILE_ERROR_OK, and remaining arguments are valid to | 44 // On success, |error| is FILE_ERROR_OK, and remaining arguments are valid to |
44 // use. | 45 // use. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 bool is_recursive, | 113 bool is_recursive, |
113 const FileOperationCallback& callback); | 114 const FileOperationCallback& callback); |
114 | 115 |
115 // Wrapper function for touch_operation_. | 116 // Wrapper function for touch_operation_. |
116 // |callback| must not be null. | 117 // |callback| must not be null. |
117 void TouchFile(const base::FilePath& file_path, | 118 void TouchFile(const base::FilePath& file_path, |
118 const base::Time& last_access_time, | 119 const base::Time& last_access_time, |
119 const base::Time& last_modified_time, | 120 const base::Time& last_modified_time, |
120 const FileOperationCallback& callback); | 121 const FileOperationCallback& callback); |
121 | 122 |
| 123 // Wrapper function for download_operation_. |
| 124 // |completion_callback| must not be null. |
| 125 void EnsureFileDownloaded( |
| 126 const base::FilePath& file_path, |
| 127 DriveClientContext context, |
| 128 const GetFileContentInitializedCallback& initialized_callback, |
| 129 const google_apis::GetContentCallback& get_content_callback, |
| 130 const GetFileCallback& completion_callback); |
| 131 |
122 // Wrapper function for update_operation_. | 132 // Wrapper function for update_operation_. |
123 // |callback| must not be null. | 133 // |callback| must not be null. |
124 void UpdateFileByResourceId(const std::string& resource_id, | 134 void UpdateFileByResourceId(const std::string& resource_id, |
125 DriveClientContext context, | 135 DriveClientContext context, |
126 const FileOperationCallback& callback); | 136 const FileOperationCallback& callback); |
127 | 137 |
128 // Wrapper function for search_operation_. | 138 // Wrapper function for search_operation_. |
129 // |callback| must not be null. | 139 // |callback| must not be null. |
130 void Search(const std::string& search_query, | 140 void Search(const std::string& search_query, |
131 const GURL& next_feed, | 141 const GURL& next_feed, |
132 const SearchOperationCallback& callback); | 142 const SearchOperationCallback& callback); |
133 | 143 |
134 private: | 144 private: |
135 scoped_ptr<CopyOperation> copy_operation_; | 145 scoped_ptr<CopyOperation> copy_operation_; |
136 scoped_ptr<CreateDirectoryOperation> create_directory_operation_; | 146 scoped_ptr<CreateDirectoryOperation> create_directory_operation_; |
137 scoped_ptr<CreateFileOperation> create_file_operation_; | 147 scoped_ptr<CreateFileOperation> create_file_operation_; |
138 scoped_ptr<MoveOperation> move_operation_; | 148 scoped_ptr<MoveOperation> move_operation_; |
139 scoped_ptr<RemoveOperation> remove_operation_; | 149 scoped_ptr<RemoveOperation> remove_operation_; |
140 scoped_ptr<TouchOperation> touch_operation_; | 150 scoped_ptr<TouchOperation> touch_operation_; |
| 151 scoped_ptr<DownloadOperation> download_operation_; |
141 scoped_ptr<UpdateOperation> update_operation_; | 152 scoped_ptr<UpdateOperation> update_operation_; |
142 scoped_ptr<SearchOperation> search_operation_; | 153 scoped_ptr<SearchOperation> search_operation_; |
143 }; | 154 }; |
144 | 155 |
145 } // namespace file_system | 156 } // namespace file_system |
146 } // namespace drive | 157 } // namespace drive |
147 | 158 |
148 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATIONS_H_ | 159 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATIONS_H_ |
OLD | NEW |