Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: google_apis/drive/drive_api_requests.h

Issue 140783006: drive: Support authorizing third-party Drive apps for opening files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/drive/drive_app_registry.cc ('k') | google_apis/drive/drive_api_requests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 GOOGLE_APIS_DRIVE_DRIVE_API_REQUESTS_H_ 5 #ifndef GOOGLE_APIS_DRIVE_DRIVE_API_REQUESTS_H_
6 #define GOOGLE_APIS_DRIVE_DRIVE_API_REQUESTS_H_ 6 #define GOOGLE_APIS_DRIVE_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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // Overridden from DriveApiDataRequest. 86 // Overridden from DriveApiDataRequest.
87 virtual GURL GetURLInternal() const OVERRIDE; 87 virtual GURL GetURLInternal() const OVERRIDE;
88 88
89 private: 89 private:
90 const DriveApiUrlGenerator url_generator_; 90 const DriveApiUrlGenerator url_generator_;
91 std::string file_id_; 91 std::string file_id_;
92 92
93 DISALLOW_COPY_AND_ASSIGN(FilesGetRequest); 93 DISALLOW_COPY_AND_ASSIGN(FilesGetRequest);
94 }; 94 };
95 95
96 //============================ FilesAuthorizeRequest ===========================
97
98 // This class performs request for authorizing an app to access a file.
99 // This request is mapped to /drive/v2internal/file/authorize internal endpoint.
100 class FilesAuthorizeRequest : public DriveApiDataRequest {
101 public:
102 FilesAuthorizeRequest(RequestSender* sender,
103 const DriveApiUrlGenerator& url_generator,
104 const FileResourceCallback& callback);
105 virtual ~FilesAuthorizeRequest();
106
107 // Required parameter.
108 const std::string& file_id() const { return file_id_; }
109 void set_file_id(const std::string& file_id) { file_id_ = file_id; }
110 const std::string& app_id() const { return app_id_; }
111 void set_app_id(const std::string& app_id) { app_id_ = app_id; }
112
113 protected:
114 // Overridden from GetDataRequest.
115 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE;
116
117 // Overridden from DriveApiDataRequest.
118 virtual GURL GetURLInternal() const OVERRIDE;
119
120 private:
121 const DriveApiUrlGenerator url_generator_;
122 std::string file_id_;
123 std::string app_id_;
124
125 DISALLOW_COPY_AND_ASSIGN(FilesAuthorizeRequest);
126 };
127
96 //============================ FilesInsertRequest ============================= 128 //============================ FilesInsertRequest =============================
97 129
98 // This class performs the request for creating a resource. 130 // This class performs the request for creating a resource.
99 // This request is mapped to 131 // This request is mapped to
100 // https://developers.google.com/drive/v2/reference/files/insert 132 // https://developers.google.com/drive/v2/reference/files/insert
101 // See also https://developers.google.com/drive/manage-uploads and 133 // See also https://developers.google.com/drive/manage-uploads and
102 // https://developers.google.com/drive/folder 134 // https://developers.google.com/drive/folder
103 class FilesInsertRequest : public DriveApiDataRequest { 135 class FilesInsertRequest : public DriveApiDataRequest {
104 public: 136 public:
105 FilesInsertRequest(RequestSender* sender, 137 FilesInsertRequest(RequestSender* sender,
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 const ProgressCallback& progress_callback); 784 const ProgressCallback& progress_callback);
753 virtual ~DownloadFileRequest(); 785 virtual ~DownloadFileRequest();
754 786
755 DISALLOW_COPY_AND_ASSIGN(DownloadFileRequest); 787 DISALLOW_COPY_AND_ASSIGN(DownloadFileRequest);
756 }; 788 };
757 789
758 } // namespace drive 790 } // namespace drive
759 } // namespace google_apis 791 } // namespace google_apis
760 792
761 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_REQUESTS_H_ 793 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_REQUESTS_H_
OLDNEW
« no previous file with comments | « chrome/browser/drive/drive_app_registry.cc ('k') | google_apis/drive/drive_api_requests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698