| 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_DRIVE_DRIVE_UPLOADER_H_ | 5 #ifndef CHROME_BROWSER_DRIVE_DRIVE_UPLOADER_H_ |
| 6 #define CHROME_BROWSER_DRIVE_DRIVE_UPLOADER_H_ | 6 #define CHROME_BROWSER_DRIVE_DRIVE_UPLOADER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // terminated before the completion due to some errors. It can be used to | 34 // terminated before the completion due to some errors. It can be used to |
| 35 // resume it. | 35 // resume it. |
| 36 typedef base::Callback<void( | 36 typedef base::Callback<void( |
| 37 google_apis::DriveApiErrorCode error, | 37 google_apis::DriveApiErrorCode error, |
| 38 const GURL& upload_location, | 38 const GURL& upload_location, |
| 39 scoped_ptr<google_apis::FileResource> resource_entry)> | 39 scoped_ptr<google_apis::FileResource> resource_entry)> |
| 40 UploadCompletionCallback; | 40 UploadCompletionCallback; |
| 41 | 41 |
| 42 class DriveUploaderInterface { | 42 class DriveUploaderInterface { |
| 43 public: | 43 public: |
| 44 typedef DriveServiceInterface::UploadNewFileOptions UploadNewFileOptions; | |
| 45 typedef DriveServiceInterface::UploadExistingFileOptions | |
| 46 UploadExistingFileOptions; | |
| 47 | |
| 48 virtual ~DriveUploaderInterface() {} | 44 virtual ~DriveUploaderInterface() {} |
| 49 | 45 |
| 50 // Uploads a new file to a directory specified by |upload_location|. | 46 // Uploads a new file to a directory specified by |upload_location|. |
| 51 // Returns a callback for cancelling the uploading job. | 47 // Returns a callback for cancelling the uploading job. |
| 52 // | 48 // |
| 53 // parent_resource_id: | 49 // parent_resource_id: |
| 54 // resource id of the destination directory. | 50 // resource id of the destination directory. |
| 55 // | 51 // |
| 56 // local_file_path: | 52 // local_file_path: |
| 57 // The path to the local file to be uploaded. | 53 // The path to the local file to be uploaded. |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 210 |
| 215 // Note: This should remain the last member so it'll be destroyed and | 211 // Note: This should remain the last member so it'll be destroyed and |
| 216 // invalidate its weak pointers before any other members are destroyed. | 212 // invalidate its weak pointers before any other members are destroyed. |
| 217 base::WeakPtrFactory<DriveUploader> weak_ptr_factory_; | 213 base::WeakPtrFactory<DriveUploader> weak_ptr_factory_; |
| 218 DISALLOW_COPY_AND_ASSIGN(DriveUploader); | 214 DISALLOW_COPY_AND_ASSIGN(DriveUploader); |
| 219 }; | 215 }; |
| 220 | 216 |
| 221 } // namespace drive | 217 } // namespace drive |
| 222 | 218 |
| 223 #endif // CHROME_BROWSER_DRIVE_DRIVE_UPLOADER_H_ | 219 #endif // CHROME_BROWSER_DRIVE_DRIVE_UPLOADER_H_ |
| OLD | NEW |