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_API_REQUESTS_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_REQUESTS_H_ |
6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_REQUESTS_H_ | 6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_REQUESTS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 protected: | 276 protected: |
277 // Overridden from GetDataRequest. | 277 // Overridden from GetDataRequest. |
278 virtual GURL GetURL() const OVERRIDE; | 278 virtual GURL GetURL() const OVERRIDE; |
279 | 279 |
280 private: | 280 private: |
281 GURL next_link_; | 281 GURL next_link_; |
282 | 282 |
283 DISALLOW_COPY_AND_ASSIGN(FilesListNextPageRequest); | 283 DISALLOW_COPY_AND_ASSIGN(FilesListNextPageRequest); |
284 }; | 284 }; |
285 | 285 |
286 //=========================== TrashResourceRequest =========================== | 286 //============================= FilesTrashRequest ============================= |
287 | 287 |
288 // This class performs the request for trashing a resource. | 288 // This class performs the request for trashing a resource. |
289 // This request is mapped to | 289 // This request is mapped to |
290 // https://developers.google.com/drive/v2/reference/files/trash | 290 // https://developers.google.com/drive/v2/reference/files/trash |
291 class FilesTrashRequest : public GetDataRequest { | 291 class FilesTrashRequest : public GetDataRequest { |
292 public: | 292 public: |
293 FilesTrashRequest(RequestSender* sender, | 293 FilesTrashRequest(RequestSender* sender, |
294 const DriveApiUrlGenerator& url_generator, | 294 const DriveApiUrlGenerator& url_generator, |
295 const FileResourceCallback& callback); | 295 const FileResourceCallback& callback); |
296 virtual ~FilesTrashRequest(); | 296 virtual ~FilesTrashRequest(); |
297 | 297 |
298 // Required parameter. | 298 // Required parameter. |
299 const std::string& file_id() const { return file_id_; } | 299 const std::string& file_id() const { return file_id_; } |
300 void set_file_id(const std::string& file_id) { file_id_ = file_id; } | 300 void set_file_id(const std::string& file_id) { file_id_ = file_id; } |
301 | 301 |
302 protected: | 302 protected: |
303 // UrlFetchRequestBase overrides. | 303 // UrlFetchRequestBase overrides. |
304 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; | 304 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; |
305 virtual GURL GetURL() const OVERRIDE; | 305 virtual GURL GetURL() const OVERRIDE; |
306 | 306 |
307 private: | 307 private: |
308 const DriveApiUrlGenerator url_generator_; | 308 const DriveApiUrlGenerator url_generator_; |
309 std::string file_id_; | 309 std::string file_id_; |
310 | 310 |
311 DISALLOW_COPY_AND_ASSIGN(FilesTrashRequest); | 311 DISALLOW_COPY_AND_ASSIGN(FilesTrashRequest); |
312 }; | 312 }; |
313 | 313 |
314 | |
315 //============================== AboutGetRequest ============================= | 314 //============================== AboutGetRequest ============================= |
316 | 315 |
317 // This class performs the request for fetching About data. | 316 // This class performs the request for fetching About data. |
318 // This request is mapped to | 317 // This request is mapped to |
319 // https://developers.google.com/drive/v2/reference/about/get | 318 // https://developers.google.com/drive/v2/reference/about/get |
320 class AboutGetRequest : public GetDataRequest { | 319 class AboutGetRequest : public GetDataRequest { |
321 public: | 320 public: |
322 AboutGetRequest(RequestSender* sender, | 321 AboutGetRequest(RequestSender* sender, |
323 const DriveApiUrlGenerator& url_generator, | 322 const DriveApiUrlGenerator& url_generator, |
324 const AboutResourceCallback& callback); | 323 const AboutResourceCallback& callback); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 protected: | 421 protected: |
423 // Overridden from GetDataRequest. | 422 // Overridden from GetDataRequest. |
424 virtual GURL GetURL() const OVERRIDE; | 423 virtual GURL GetURL() const OVERRIDE; |
425 | 424 |
426 private: | 425 private: |
427 const DriveApiUrlGenerator url_generator_; | 426 const DriveApiUrlGenerator url_generator_; |
428 | 427 |
429 DISALLOW_COPY_AND_ASSIGN(AppsListRequest); | 428 DISALLOW_COPY_AND_ASSIGN(AppsListRequest); |
430 }; | 429 }; |
431 | 430 |
432 //======================= ContinueGetFileListRequest ========================= | |
433 | |
434 // This class performs the request to fetch remaining Filelist result. | |
435 class ContinueGetFileListRequest : public GetDataRequest { | |
436 public: | |
437 ContinueGetFileListRequest(RequestSender* sender, | |
438 const GURL& url, | |
439 const GetDataCallback& callback); | |
440 virtual ~ContinueGetFileListRequest(); | |
441 | |
442 protected: | |
443 virtual GURL GetURL() const OVERRIDE; | |
444 | |
445 private: | |
446 const GURL url_; | |
447 | |
448 DISALLOW_COPY_AND_ASSIGN(ContinueGetFileListRequest); | |
449 }; | |
450 | |
451 //========================== ChildrenInsertRequest ============================ | 431 //========================== ChildrenInsertRequest ============================ |
452 | 432 |
453 // This class performs the request for inserting a resource to a directory. | 433 // This class performs the request for inserting a resource to a directory. |
454 // This request is mapped to | 434 // This request is mapped to |
455 // https://developers.google.com/drive/v2/reference/children/insert | 435 // https://developers.google.com/drive/v2/reference/children/insert |
456 class ChildrenInsertRequest : public EntryActionRequest { | 436 class ChildrenInsertRequest : public EntryActionRequest { |
457 public: | 437 public: |
458 ChildrenInsertRequest(RequestSender* sender, | 438 ChildrenInsertRequest(RequestSender* sender, |
459 const DriveApiUrlGenerator& url_generator, | 439 const DriveApiUrlGenerator& url_generator, |
460 const EntryActionCallback& callback); | 440 const EntryActionCallback& callback); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 const std::string parent_resource_id_; | 532 const std::string parent_resource_id_; |
553 const std::string title_; | 533 const std::string title_; |
554 | 534 |
555 DISALLOW_COPY_AND_ASSIGN(InitiateUploadNewFileRequest); | 535 DISALLOW_COPY_AND_ASSIGN(InitiateUploadNewFileRequest); |
556 }; | 536 }; |
557 | 537 |
558 //==================== InitiateUploadExistingFileRequest ===================== | 538 //==================== InitiateUploadExistingFileRequest ===================== |
559 | 539 |
560 // This class performs the request for initiating the upload of an existing | 540 // This class performs the request for initiating the upload of an existing |
561 // file. | 541 // file. |
562 class InitiateUploadExistingFileRequest | 542 class InitiateUploadExistingFileRequest : public InitiateUploadRequestBase { |
563 : public InitiateUploadRequestBase { | |
564 public: | 543 public: |
565 // |upload_url| should be the upload_url() of the file | 544 // |upload_url| should be the upload_url() of the file |
566 // (resumable-create-media URL) | 545 // (resumable-create-media URL) |
567 // |etag| should be set if it is available to detect the upload confliction. | 546 // |etag| should be set if it is available to detect the upload confliction. |
568 // See also the comments of InitiateUploadRequestBase for more details | 547 // See also the comments of InitiateUploadRequestBase for more details |
569 // about the other parameters. | 548 // about the other parameters. |
570 InitiateUploadExistingFileRequest(RequestSender* sender, | 549 InitiateUploadExistingFileRequest(RequestSender* sender, |
571 const DriveApiUrlGenerator& url_generator, | 550 const DriveApiUrlGenerator& url_generator, |
572 const std::string& content_type, | 551 const std::string& content_type, |
573 int64 content_length, | 552 int64 content_length, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 const ProgressCallback& progress_callback); | 648 const ProgressCallback& progress_callback); |
670 virtual ~DownloadFileRequest(); | 649 virtual ~DownloadFileRequest(); |
671 | 650 |
672 DISALLOW_COPY_AND_ASSIGN(DownloadFileRequest); | 651 DISALLOW_COPY_AND_ASSIGN(DownloadFileRequest); |
673 }; | 652 }; |
674 | 653 |
675 } // namespace drive | 654 } // namespace drive |
676 } // namespace google_apis | 655 } // namespace google_apis |
677 | 656 |
678 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_REQUESTS_H_ | 657 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_REQUESTS_H_ |
OLD | NEW |