| 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_GDATA_WAPI_OPERATIONS_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ |
| 6 #define CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ | 6 #define CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // search_string: | 39 // search_string: |
| 40 // If non-empty, fetches a list of resources that match the search | 40 // If non-empty, fetches a list of resources that match the search |
| 41 // string. | 41 // string. |
| 42 // | 42 // |
| 43 // directory_resource_id: | 43 // directory_resource_id: |
| 44 // If non-empty, fetches a list of resources in a particular directory. | 44 // If non-empty, fetches a list of resources in a particular directory. |
| 45 // | 45 // |
| 46 // callback: | 46 // callback: |
| 47 // Called once the feed is fetched. Must not be null. | 47 // Called once the feed is fetched. Must not be null. |
| 48 GetResourceListOperation( | 48 GetResourceListOperation( |
| 49 OperationRegistry* registry, | 49 OperationRunner* runner, |
| 50 net::URLRequestContextGetter* url_request_context_getter, | 50 net::URLRequestContextGetter* url_request_context_getter, |
| 51 const GDataWapiUrlGenerator& url_generator, | 51 const GDataWapiUrlGenerator& url_generator, |
| 52 const GURL& override_url, | 52 const GURL& override_url, |
| 53 int64 start_changestamp, | 53 int64 start_changestamp, |
| 54 const std::string& search_string, | 54 const std::string& search_string, |
| 55 const std::string& directory_resource_id, | 55 const std::string& directory_resource_id, |
| 56 const GetResourceListCallback& callback); | 56 const GetResourceListCallback& callback); |
| 57 virtual ~GetResourceListOperation(); | 57 virtual ~GetResourceListOperation(); |
| 58 | 58 |
| 59 protected: | 59 protected: |
| (...skipping 17 matching lines...) Expand all Loading... |
| 77 public: | 77 public: |
| 78 // title: the search query. | 78 // title: the search query. |
| 79 // | 79 // |
| 80 // directory_resource_id: If given (non-empty), the search target is | 80 // directory_resource_id: If given (non-empty), the search target is |
| 81 // directly under the directory with the |directory_resource_id|. | 81 // directly under the directory with the |directory_resource_id|. |
| 82 // If empty, the search target is all the existing resources. | 82 // If empty, the search target is all the existing resources. |
| 83 // | 83 // |
| 84 // callback: | 84 // callback: |
| 85 // Called once the feed is fetched. Must not be null. | 85 // Called once the feed is fetched. Must not be null. |
| 86 SearchByTitleOperation( | 86 SearchByTitleOperation( |
| 87 OperationRegistry* registry, | 87 OperationRunner* runner, |
| 88 net::URLRequestContextGetter* url_request_context_getter, | 88 net::URLRequestContextGetter* url_request_context_getter, |
| 89 const GDataWapiUrlGenerator& url_generator, | 89 const GDataWapiUrlGenerator& url_generator, |
| 90 const std::string& title, | 90 const std::string& title, |
| 91 const std::string& directory_resource_id, | 91 const std::string& directory_resource_id, |
| 92 const GetResourceListCallback& callback); | 92 const GetResourceListCallback& callback); |
| 93 virtual ~SearchByTitleOperation(); | 93 virtual ~SearchByTitleOperation(); |
| 94 | 94 |
| 95 protected: | 95 protected: |
| 96 // UrlFetchOperationBase overrides. | 96 // UrlFetchOperationBase overrides. |
| 97 virtual GURL GetURL() const OVERRIDE; | 97 virtual GURL GetURL() const OVERRIDE; |
| 98 | 98 |
| 99 private: | 99 private: |
| 100 const GDataWapiUrlGenerator url_generator_; | 100 const GDataWapiUrlGenerator url_generator_; |
| 101 const std::string title_; | 101 const std::string title_; |
| 102 const std::string directory_resource_id_; | 102 const std::string directory_resource_id_; |
| 103 | 103 |
| 104 DISALLOW_COPY_AND_ASSIGN(SearchByTitleOperation); | 104 DISALLOW_COPY_AND_ASSIGN(SearchByTitleOperation); |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 //========================= GetResourceEntryOperation ========================== | 107 //========================= GetResourceEntryOperation ========================== |
| 108 | 108 |
| 109 // This class performs the operation for fetching a single resource entry. | 109 // This class performs the operation for fetching a single resource entry. |
| 110 class GetResourceEntryOperation : public GetDataOperation { | 110 class GetResourceEntryOperation : public GetDataOperation { |
| 111 public: | 111 public: |
| 112 // |callback| must not be null. | 112 // |callback| must not be null. |
| 113 GetResourceEntryOperation( | 113 GetResourceEntryOperation( |
| 114 OperationRegistry* registry, | 114 OperationRunner* runner, |
| 115 net::URLRequestContextGetter* url_request_context_getter, | 115 net::URLRequestContextGetter* url_request_context_getter, |
| 116 const GDataWapiUrlGenerator& url_generator, | 116 const GDataWapiUrlGenerator& url_generator, |
| 117 const std::string& resource_id, | 117 const std::string& resource_id, |
| 118 const GetDataCallback& callback); | 118 const GetDataCallback& callback); |
| 119 virtual ~GetResourceEntryOperation(); | 119 virtual ~GetResourceEntryOperation(); |
| 120 | 120 |
| 121 protected: | 121 protected: |
| 122 // UrlFetchOperationBase overrides. | 122 // UrlFetchOperationBase overrides. |
| 123 virtual GURL GetURL() const OVERRIDE; | 123 virtual GURL GetURL() const OVERRIDE; |
| 124 | 124 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 137 scoped_ptr<AccountMetadata> account_metadata)> | 137 scoped_ptr<AccountMetadata> account_metadata)> |
| 138 GetAccountMetadataCallback; | 138 GetAccountMetadataCallback; |
| 139 | 139 |
| 140 // This class performs the operation for fetching account metadata. | 140 // This class performs the operation for fetching account metadata. |
| 141 class GetAccountMetadataOperation : public GetDataOperation { | 141 class GetAccountMetadataOperation : public GetDataOperation { |
| 142 public: | 142 public: |
| 143 // If |include_installed_apps| is set to true, the result should include | 143 // If |include_installed_apps| is set to true, the result should include |
| 144 // the list of installed third party applications. | 144 // the list of installed third party applications. |
| 145 // |callback| must not be null. | 145 // |callback| must not be null. |
| 146 GetAccountMetadataOperation( | 146 GetAccountMetadataOperation( |
| 147 OperationRegistry* registry, | 147 OperationRunner* runner, |
| 148 net::URLRequestContextGetter* url_request_context_getter, | 148 net::URLRequestContextGetter* url_request_context_getter, |
| 149 const GDataWapiUrlGenerator& url_generator, | 149 const GDataWapiUrlGenerator& url_generator, |
| 150 const GetAccountMetadataCallback& callback, | 150 const GetAccountMetadataCallback& callback, |
| 151 bool include_installed_apps); | 151 bool include_installed_apps); |
| 152 virtual ~GetAccountMetadataOperation(); | 152 virtual ~GetAccountMetadataOperation(); |
| 153 | 153 |
| 154 protected: | 154 protected: |
| 155 // UrlFetchOperationBase overrides. | 155 // UrlFetchOperationBase overrides. |
| 156 virtual GURL GetURL() const OVERRIDE; | 156 virtual GURL GetURL() const OVERRIDE; |
| 157 | 157 |
| 158 private: | 158 private: |
| 159 const GDataWapiUrlGenerator url_generator_; | 159 const GDataWapiUrlGenerator url_generator_; |
| 160 const bool include_installed_apps_; | 160 const bool include_installed_apps_; |
| 161 | 161 |
| 162 DISALLOW_COPY_AND_ASSIGN(GetAccountMetadataOperation); | 162 DISALLOW_COPY_AND_ASSIGN(GetAccountMetadataOperation); |
| 163 }; | 163 }; |
| 164 | 164 |
| 165 //=========================== DeleteResourceOperation ========================== | 165 //=========================== DeleteResourceOperation ========================== |
| 166 | 166 |
| 167 // This class performs the operation for deleting a resource. | 167 // This class performs the operation for deleting a resource. |
| 168 // | 168 // |
| 169 // In WAPI, "gd:deleted" means that the resource was put in the trash, and | 169 // In WAPI, "gd:deleted" means that the resource was put in the trash, and |
| 170 // "docs:removed" means its permanently gone. Since what the class does is to | 170 // "docs:removed" means its permanently gone. Since what the class does is to |
| 171 // put the resource into trash, we have chosen "Delete" in the name, even though | 171 // put the resource into trash, we have chosen "Delete" in the name, even though |
| 172 // we are preferring the term "Remove" in drive/google_api code. | 172 // we are preferring the term "Remove" in drive/google_api code. |
| 173 class DeleteResourceOperation : public EntryActionOperation { | 173 class DeleteResourceOperation : public EntryActionOperation { |
| 174 public: | 174 public: |
| 175 // |callback| must not be null. | 175 // |callback| must not be null. |
| 176 DeleteResourceOperation( | 176 DeleteResourceOperation( |
| 177 OperationRegistry* registry, | 177 OperationRunner* runner, |
| 178 net::URLRequestContextGetter* url_request_context_getter, | 178 net::URLRequestContextGetter* url_request_context_getter, |
| 179 const GDataWapiUrlGenerator& url_generator, | 179 const GDataWapiUrlGenerator& url_generator, |
| 180 const EntryActionCallback& callback, | 180 const EntryActionCallback& callback, |
| 181 const std::string& resource_id, | 181 const std::string& resource_id, |
| 182 const std::string& etag); | 182 const std::string& etag); |
| 183 virtual ~DeleteResourceOperation(); | 183 virtual ~DeleteResourceOperation(); |
| 184 | 184 |
| 185 protected: | 185 protected: |
| 186 // UrlFetchOperationBase overrides. | 186 // UrlFetchOperationBase overrides. |
| 187 virtual GURL GetURL() const OVERRIDE; | 187 virtual GURL GetURL() const OVERRIDE; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 199 //========================== CreateDirectoryOperation ========================== | 199 //========================== CreateDirectoryOperation ========================== |
| 200 | 200 |
| 201 // This class performs the operation for creating a directory. | 201 // This class performs the operation for creating a directory. |
| 202 class CreateDirectoryOperation : public GetDataOperation { | 202 class CreateDirectoryOperation : public GetDataOperation { |
| 203 public: | 203 public: |
| 204 // A new directory will be created under a directory specified by | 204 // A new directory will be created under a directory specified by |
| 205 // |parent_resource_id|. If this parameter is empty, a new directory will | 205 // |parent_resource_id|. If this parameter is empty, a new directory will |
| 206 // be created in the root directory. | 206 // be created in the root directory. |
| 207 // |callback| must not be null. | 207 // |callback| must not be null. |
| 208 CreateDirectoryOperation( | 208 CreateDirectoryOperation( |
| 209 OperationRegistry* registry, | 209 OperationRunner* runner, |
| 210 net::URLRequestContextGetter* url_request_context_getter, | 210 net::URLRequestContextGetter* url_request_context_getter, |
| 211 const GDataWapiUrlGenerator& url_generator, | 211 const GDataWapiUrlGenerator& url_generator, |
| 212 const GetDataCallback& callback, | 212 const GetDataCallback& callback, |
| 213 const std::string& parent_resource_id, | 213 const std::string& parent_resource_id, |
| 214 const std::string& directory_name); | 214 const std::string& directory_name); |
| 215 virtual ~CreateDirectoryOperation(); | 215 virtual ~CreateDirectoryOperation(); |
| 216 | 216 |
| 217 protected: | 217 protected: |
| 218 // UrlFetchOperationBase overrides. | 218 // UrlFetchOperationBase overrides. |
| 219 virtual GURL GetURL() const OVERRIDE; | 219 virtual GURL GetURL() const OVERRIDE; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 231 | 231 |
| 232 //============================ CopyHostedDocumentOperation ===================== | 232 //============================ CopyHostedDocumentOperation ===================== |
| 233 | 233 |
| 234 // This class performs the operation for making a copy of a hosted document. | 234 // This class performs the operation for making a copy of a hosted document. |
| 235 // Note that this function cannot be used to copy regular files, as it's not | 235 // Note that this function cannot be used to copy regular files, as it's not |
| 236 // supported by WAPI. | 236 // supported by WAPI. |
| 237 class CopyHostedDocumentOperation : public GetDataOperation { | 237 class CopyHostedDocumentOperation : public GetDataOperation { |
| 238 public: | 238 public: |
| 239 // |callback| must not be null. | 239 // |callback| must not be null. |
| 240 CopyHostedDocumentOperation( | 240 CopyHostedDocumentOperation( |
| 241 OperationRegistry* registry, | 241 OperationRunner* runner, |
| 242 net::URLRequestContextGetter* url_request_context_getter, | 242 net::URLRequestContextGetter* url_request_context_getter, |
| 243 const GDataWapiUrlGenerator& url_generator, | 243 const GDataWapiUrlGenerator& url_generator, |
| 244 const GetDataCallback& callback, | 244 const GetDataCallback& callback, |
| 245 const std::string& resource_id, | 245 const std::string& resource_id, |
| 246 const std::string& new_name); | 246 const std::string& new_name); |
| 247 virtual ~CopyHostedDocumentOperation(); | 247 virtual ~CopyHostedDocumentOperation(); |
| 248 | 248 |
| 249 protected: | 249 protected: |
| 250 // UrlFetchOperationBase overrides. | 250 // UrlFetchOperationBase overrides. |
| 251 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; | 251 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; |
| 252 virtual GURL GetURL() const OVERRIDE; | 252 virtual GURL GetURL() const OVERRIDE; |
| 253 virtual bool GetContentData(std::string* upload_content_type, | 253 virtual bool GetContentData(std::string* upload_content_type, |
| 254 std::string* upload_content) OVERRIDE; | 254 std::string* upload_content) OVERRIDE; |
| 255 | 255 |
| 256 private: | 256 private: |
| 257 const GDataWapiUrlGenerator url_generator_; | 257 const GDataWapiUrlGenerator url_generator_; |
| 258 const std::string resource_id_; | 258 const std::string resource_id_; |
| 259 const std::string new_name_; | 259 const std::string new_name_; |
| 260 | 260 |
| 261 DISALLOW_COPY_AND_ASSIGN(CopyHostedDocumentOperation); | 261 DISALLOW_COPY_AND_ASSIGN(CopyHostedDocumentOperation); |
| 262 }; | 262 }; |
| 263 | 263 |
| 264 //=========================== RenameResourceOperation ========================== | 264 //=========================== RenameResourceOperation ========================== |
| 265 | 265 |
| 266 // This class performs the operation for renaming a document/file/directory. | 266 // This class performs the operation for renaming a document/file/directory. |
| 267 class RenameResourceOperation : public EntryActionOperation { | 267 class RenameResourceOperation : public EntryActionOperation { |
| 268 public: | 268 public: |
| 269 // |callback| must not be null. | 269 // |callback| must not be null. |
| 270 RenameResourceOperation( | 270 RenameResourceOperation( |
| 271 OperationRegistry* registry, | 271 OperationRunner* runner, |
| 272 net::URLRequestContextGetter* url_request_context_getter, | 272 net::URLRequestContextGetter* url_request_context_getter, |
| 273 const GDataWapiUrlGenerator& url_generator, | 273 const GDataWapiUrlGenerator& url_generator, |
| 274 const EntryActionCallback& callback, | 274 const EntryActionCallback& callback, |
| 275 const std::string& resource_id, | 275 const std::string& resource_id, |
| 276 const std::string& new_name); | 276 const std::string& new_name); |
| 277 virtual ~RenameResourceOperation(); | 277 virtual ~RenameResourceOperation(); |
| 278 | 278 |
| 279 protected: | 279 protected: |
| 280 // UrlFetchOperationBase overrides. | 280 // UrlFetchOperationBase overrides. |
| 281 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; | 281 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 293 }; | 293 }; |
| 294 | 294 |
| 295 //=========================== AuthorizeAppOperation ========================== | 295 //=========================== AuthorizeAppOperation ========================== |
| 296 | 296 |
| 297 // This class performs the operation for authorizing an application specified | 297 // This class performs the operation for authorizing an application specified |
| 298 // by |app_id| to access a document specified by |resource_id|. | 298 // by |app_id| to access a document specified by |resource_id|. |
| 299 class AuthorizeAppOperation : public GetDataOperation { | 299 class AuthorizeAppOperation : public GetDataOperation { |
| 300 public: | 300 public: |
| 301 // |callback| must not be null. | 301 // |callback| must not be null. |
| 302 AuthorizeAppOperation( | 302 AuthorizeAppOperation( |
| 303 OperationRegistry* registry, | 303 OperationRunner* runner, |
| 304 net::URLRequestContextGetter* url_request_context_getter, | 304 net::URLRequestContextGetter* url_request_context_getter, |
| 305 const GDataWapiUrlGenerator& url_generator, | 305 const GDataWapiUrlGenerator& url_generator, |
| 306 const AuthorizeAppCallback& callback, | 306 const AuthorizeAppCallback& callback, |
| 307 const std::string& resource_id, | 307 const std::string& resource_id, |
| 308 const std::string& app_id); | 308 const std::string& app_id); |
| 309 virtual ~AuthorizeAppOperation(); | 309 virtual ~AuthorizeAppOperation(); |
| 310 | 310 |
| 311 protected: | 311 protected: |
| 312 // UrlFetchOperationBase overrides. | 312 // UrlFetchOperationBase overrides. |
| 313 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; | 313 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 325 }; | 325 }; |
| 326 | 326 |
| 327 //======================= AddResourceToDirectoryOperation ====================== | 327 //======================= AddResourceToDirectoryOperation ====================== |
| 328 | 328 |
| 329 // This class performs the operation for adding a document/file/directory | 329 // This class performs the operation for adding a document/file/directory |
| 330 // to a directory. | 330 // to a directory. |
| 331 class AddResourceToDirectoryOperation : public EntryActionOperation { | 331 class AddResourceToDirectoryOperation : public EntryActionOperation { |
| 332 public: | 332 public: |
| 333 // |callback| must not be null. | 333 // |callback| must not be null. |
| 334 AddResourceToDirectoryOperation( | 334 AddResourceToDirectoryOperation( |
| 335 OperationRegistry* registry, | 335 OperationRunner* runner, |
| 336 net::URLRequestContextGetter* url_request_context_getter, | 336 net::URLRequestContextGetter* url_request_context_getter, |
| 337 const GDataWapiUrlGenerator& url_generator, | 337 const GDataWapiUrlGenerator& url_generator, |
| 338 const EntryActionCallback& callback, | 338 const EntryActionCallback& callback, |
| 339 const std::string& parent_resource_id, | 339 const std::string& parent_resource_id, |
| 340 const std::string& resource_id); | 340 const std::string& resource_id); |
| 341 virtual ~AddResourceToDirectoryOperation(); | 341 virtual ~AddResourceToDirectoryOperation(); |
| 342 | 342 |
| 343 protected: | 343 protected: |
| 344 // UrlFetchOperationBase overrides. | 344 // UrlFetchOperationBase overrides. |
| 345 virtual GURL GetURL() const OVERRIDE; | 345 virtual GURL GetURL() const OVERRIDE; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 356 }; | 356 }; |
| 357 | 357 |
| 358 //==================== RemoveResourceFromDirectoryOperation ==================== | 358 //==================== RemoveResourceFromDirectoryOperation ==================== |
| 359 | 359 |
| 360 // This class performs the operation for removing a document/file/directory | 360 // This class performs the operation for removing a document/file/directory |
| 361 // from a directory. | 361 // from a directory. |
| 362 class RemoveResourceFromDirectoryOperation : public EntryActionOperation { | 362 class RemoveResourceFromDirectoryOperation : public EntryActionOperation { |
| 363 public: | 363 public: |
| 364 // |callback| must not be null. | 364 // |callback| must not be null. |
| 365 RemoveResourceFromDirectoryOperation( | 365 RemoveResourceFromDirectoryOperation( |
| 366 OperationRegistry* registry, | 366 OperationRunner* runner, |
| 367 net::URLRequestContextGetter* url_request_context_getter, | 367 net::URLRequestContextGetter* url_request_context_getter, |
| 368 const GDataWapiUrlGenerator& url_generator, | 368 const GDataWapiUrlGenerator& url_generator, |
| 369 const EntryActionCallback& callback, | 369 const EntryActionCallback& callback, |
| 370 const std::string& parent_resource_id, | 370 const std::string& parent_resource_id, |
| 371 const std::string& resource_id); | 371 const std::string& resource_id); |
| 372 virtual ~RemoveResourceFromDirectoryOperation(); | 372 virtual ~RemoveResourceFromDirectoryOperation(); |
| 373 | 373 |
| 374 protected: | 374 protected: |
| 375 // UrlFetchOperationBase overrides. | 375 // UrlFetchOperationBase overrides. |
| 376 virtual GURL GetURL() const OVERRIDE; | 376 virtual GURL GetURL() const OVERRIDE; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 389 | 389 |
| 390 // This class performs the operation for initiating the upload of a new file. | 390 // This class performs the operation for initiating the upload of a new file. |
| 391 class InitiateUploadNewFileOperation : public InitiateUploadOperationBase { | 391 class InitiateUploadNewFileOperation : public InitiateUploadOperationBase { |
| 392 public: | 392 public: |
| 393 // |title| should be set. | 393 // |title| should be set. |
| 394 // |parent_upload_url| should be the upload_url() of the parent directory. | 394 // |parent_upload_url| should be the upload_url() of the parent directory. |
| 395 // (resumable-create-media URL) | 395 // (resumable-create-media URL) |
| 396 // See also the comments of InitiateUploadOperationBase for more details | 396 // See also the comments of InitiateUploadOperationBase for more details |
| 397 // about the other parameters. | 397 // about the other parameters. |
| 398 InitiateUploadNewFileOperation( | 398 InitiateUploadNewFileOperation( |
| 399 OperationRegistry* registry, | 399 OperationRunner* runner, |
| 400 net::URLRequestContextGetter* url_request_context_getter, | 400 net::URLRequestContextGetter* url_request_context_getter, |
| 401 const GDataWapiUrlGenerator& url_generator, | 401 const GDataWapiUrlGenerator& url_generator, |
| 402 const InitiateUploadCallback& callback, | 402 const InitiateUploadCallback& callback, |
| 403 const base::FilePath& drive_file_path, | 403 const base::FilePath& drive_file_path, |
| 404 const std::string& content_type, | 404 const std::string& content_type, |
| 405 int64 content_length, | 405 int64 content_length, |
| 406 const std::string& parent_resource_id, | 406 const std::string& parent_resource_id, |
| 407 const std::string& title); | 407 const std::string& title); |
| 408 virtual ~InitiateUploadNewFileOperation(); | 408 virtual ~InitiateUploadNewFileOperation(); |
| 409 | 409 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 428 // file. | 428 // file. |
| 429 class InitiateUploadExistingFileOperation | 429 class InitiateUploadExistingFileOperation |
| 430 : public InitiateUploadOperationBase { | 430 : public InitiateUploadOperationBase { |
| 431 public: | 431 public: |
| 432 // |upload_url| should be the upload_url() of the file | 432 // |upload_url| should be the upload_url() of the file |
| 433 // (resumable-create-media URL) | 433 // (resumable-create-media URL) |
| 434 // |etag| should be set if it is available to detect the upload confliction. | 434 // |etag| should be set if it is available to detect the upload confliction. |
| 435 // See also the comments of InitiateUploadOperationBase for more details | 435 // See also the comments of InitiateUploadOperationBase for more details |
| 436 // about the other parameters. | 436 // about the other parameters. |
| 437 InitiateUploadExistingFileOperation( | 437 InitiateUploadExistingFileOperation( |
| 438 OperationRegistry* registry, | 438 OperationRunner* runner, |
| 439 net::URLRequestContextGetter* url_request_context_getter, | 439 net::URLRequestContextGetter* url_request_context_getter, |
| 440 const GDataWapiUrlGenerator& url_generator, | 440 const GDataWapiUrlGenerator& url_generator, |
| 441 const InitiateUploadCallback& callback, | 441 const InitiateUploadCallback& callback, |
| 442 const base::FilePath& drive_file_path, | 442 const base::FilePath& drive_file_path, |
| 443 const std::string& content_type, | 443 const std::string& content_type, |
| 444 int64 content_length, | 444 int64 content_length, |
| 445 const std::string& resource_id, | 445 const std::string& resource_id, |
| 446 const std::string& etag); | 446 const std::string& etag); |
| 447 virtual ~InitiateUploadExistingFileOperation(); | 447 virtual ~InitiateUploadExistingFileOperation(); |
| 448 | 448 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 463 }; | 463 }; |
| 464 | 464 |
| 465 //============================ ResumeUploadOperation =========================== | 465 //============================ ResumeUploadOperation =========================== |
| 466 | 466 |
| 467 // Performs the operation for resuming the upload of a file. | 467 // Performs the operation for resuming the upload of a file. |
| 468 class ResumeUploadOperation : public ResumeUploadOperationBase { | 468 class ResumeUploadOperation : public ResumeUploadOperationBase { |
| 469 public: | 469 public: |
| 470 // See also ResumeUploadOperationBase's comment for parameters meaining. | 470 // See also ResumeUploadOperationBase's comment for parameters meaining. |
| 471 // |callback| must not be null. | 471 // |callback| must not be null. |
| 472 ResumeUploadOperation( | 472 ResumeUploadOperation( |
| 473 OperationRegistry* registry, | 473 OperationRunner* runner, |
| 474 net::URLRequestContextGetter* url_request_context_getter, | 474 net::URLRequestContextGetter* url_request_context_getter, |
| 475 const UploadRangeCallback& callback, | 475 const UploadRangeCallback& callback, |
| 476 const ProgressCallback& progress_callback, | 476 const ProgressCallback& progress_callback, |
| 477 const base::FilePath& drive_file_path, | 477 const base::FilePath& drive_file_path, |
| 478 const GURL& upload_location, | 478 const GURL& upload_location, |
| 479 int64 start_position, | 479 int64 start_position, |
| 480 int64 end_position, | 480 int64 end_position, |
| 481 int64 content_length, | 481 int64 content_length, |
| 482 const std::string& content_type, | 482 const std::string& content_type, |
| 483 const base::FilePath& local_file_path); | 483 const base::FilePath& local_file_path); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 500 }; | 500 }; |
| 501 | 501 |
| 502 //========================== GetUploadStatusOperation ========================== | 502 //========================== GetUploadStatusOperation ========================== |
| 503 | 503 |
| 504 // Performs the operation to request the current upload status of a file. | 504 // Performs the operation to request the current upload status of a file. |
| 505 class GetUploadStatusOperation : public GetUploadStatusOperationBase { | 505 class GetUploadStatusOperation : public GetUploadStatusOperationBase { |
| 506 public: | 506 public: |
| 507 // See also GetUploadStatusOperationBase's comment for parameters meaning. | 507 // See also GetUploadStatusOperationBase's comment for parameters meaning. |
| 508 // |callback| must not be null. | 508 // |callback| must not be null. |
| 509 GetUploadStatusOperation( | 509 GetUploadStatusOperation( |
| 510 OperationRegistry* registry, | 510 OperationRunner* runner, |
| 511 net::URLRequestContextGetter* url_request_context_getter, | 511 net::URLRequestContextGetter* url_request_context_getter, |
| 512 const UploadRangeCallback& callback, | 512 const UploadRangeCallback& callback, |
| 513 const base::FilePath& drive_file_path, | 513 const base::FilePath& drive_file_path, |
| 514 const GURL& upload_url, | 514 const GURL& upload_url, |
| 515 int64 content_length); | 515 int64 content_length); |
| 516 virtual ~GetUploadStatusOperation(); | 516 virtual ~GetUploadStatusOperation(); |
| 517 | 517 |
| 518 protected: | 518 protected: |
| 519 // UploadRangeOperationBase overrides. | 519 // UploadRangeOperationBase overrides. |
| 520 virtual void OnRangeOperationComplete( | 520 virtual void OnRangeOperationComplete( |
| 521 const UploadRangeResponse& response, | 521 const UploadRangeResponse& response, |
| 522 scoped_ptr<base::Value> value) OVERRIDE; | 522 scoped_ptr<base::Value> value) OVERRIDE; |
| 523 | 523 |
| 524 private: | 524 private: |
| 525 const UploadRangeCallback callback_; | 525 const UploadRangeCallback callback_; |
| 526 | 526 |
| 527 DISALLOW_COPY_AND_ASSIGN(GetUploadStatusOperation); | 527 DISALLOW_COPY_AND_ASSIGN(GetUploadStatusOperation); |
| 528 }; | 528 }; |
| 529 | 529 |
| 530 } // namespace google_apis | 530 } // namespace google_apis |
| 531 | 531 |
| 532 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ | 532 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ |
| OLD | NEW |