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_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ |
6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ | 6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 // TODO(kochi): Further split gdata_operations.h and include only necessary | 10 // TODO(kochi): Further split gdata_operations.h and include only necessary |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // | 225 // |
226 // |download_action_callback| must not be null. | 226 // |download_action_callback| must not be null. |
227 // |get_content_callback| may be null. | 227 // |get_content_callback| may be null. |
228 virtual void DownloadFile( | 228 virtual void DownloadFile( |
229 const base::FilePath& virtual_path, | 229 const base::FilePath& virtual_path, |
230 const base::FilePath& local_cache_path, | 230 const base::FilePath& local_cache_path, |
231 const GURL& download_url, | 231 const GURL& download_url, |
232 const DownloadActionCallback& download_action_callback, | 232 const DownloadActionCallback& download_action_callback, |
233 const GetContentCallback& get_content_callback) = 0; | 233 const GetContentCallback& get_content_callback) = 0; |
234 | 234 |
235 // Initiates uploading of a document/file. | 235 // Initiates uploading of a new document/file. |
| 236 // |content_type| and |content_length| should be the ones of the file to be |
| 237 // uploaded. |
236 // |callback| must not be null. | 238 // |callback| must not be null. |
237 virtual void InitiateUpload(const InitiateUploadParams& params, | 239 // TODO(hidehiko): Replace |parent_upload_url| by resource id. |
238 const InitiateUploadCallback& callback) = 0; | 240 virtual void InitiateUploadNewFile( |
| 241 const FilePath& drive_file_path, |
| 242 const std::string& content_type, |
| 243 int64 content_length, |
| 244 const GURL& parent_upload_url, |
| 245 const std::string& title, |
| 246 const InitiateUploadCallback& callback) = 0; |
| 247 |
| 248 // Initiates uploading of an existing document/file. |
| 249 // |content_type| and |content_length| should be the ones of the file to be |
| 250 // uploaded. |
| 251 // |callback| must not be null. |
| 252 // TODO(hidehiko): Replace |upload_url| by resource id. |
| 253 virtual void InitiateUploadExistingFile( |
| 254 const FilePath& drive_file_path, |
| 255 const std::string& content_type, |
| 256 int64 content_length, |
| 257 const GURL& upload_url, |
| 258 const std::string& etag, |
| 259 const InitiateUploadCallback& callback) = 0; |
239 | 260 |
240 // Resumes uploading of a document/file on the calling thread. | 261 // Resumes uploading of a document/file on the calling thread. |
241 // |callback| must not be null. | 262 // |callback| must not be null. |
242 virtual void ResumeUpload(const ResumeUploadParams& params, | 263 virtual void ResumeUpload(const ResumeUploadParams& params, |
243 const UploadRangeCallback& callback) = 0; | 264 const UploadRangeCallback& callback) = 0; |
244 | 265 |
245 // Gets the current status of the uploading to |upload_url| from the server. | 266 // Gets the current status of the uploading to |upload_url| from the server. |
246 // |upload_mode|, |drive_file_path| and |content_length| should be set to | 267 // |upload_mode|, |drive_file_path| and |content_length| should be set to |
247 // the same value which is used for ResumeUpload. | 268 // the same value which is used for ResumeUpload. |
248 // |callback| must not be null. | 269 // |callback| must not be null. |
249 virtual void GetUploadStatus( | 270 virtual void GetUploadStatus( |
250 UploadMode upload_mode, | 271 UploadMode upload_mode, |
251 const base::FilePath& drive_file_path, | 272 const base::FilePath& drive_file_path, |
252 const GURL& upload_url, | 273 const GURL& upload_url, |
253 int64 content_length, | 274 int64 content_length, |
254 const UploadRangeCallback& callback) = 0; | 275 const UploadRangeCallback& callback) = 0; |
255 | 276 |
256 // Authorizes a Drive app with the id |app_id| to open the given file. | 277 // Authorizes a Drive app with the id |app_id| to open the given file. |
257 // Upon completion, invokes |callback| with the link to open the file with | 278 // Upon completion, invokes |callback| with the link to open the file with |
258 // the provided app. |callback| must not be null. | 279 // the provided app. |callback| must not be null. |
259 virtual void AuthorizeApp(const GURL& edit_url, | 280 virtual void AuthorizeApp(const GURL& edit_url, |
260 const std::string& app_id, | 281 const std::string& app_id, |
261 const AuthorizeAppCallback& callback) = 0; | 282 const AuthorizeAppCallback& callback) = 0; |
262 }; | 283 }; |
263 | 284 |
264 } // namespace google_apis | 285 } // namespace google_apis |
265 | 286 |
266 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ | 287 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ |
OLD | NEW |