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

Unified Diff: google_apis/drive/drive_api_requests.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « google_apis/drive/drive_api_requests.h ('k') | google_apis/drive/drive_api_url_generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/drive/drive_api_requests.cc
diff --git a/google_apis/drive/drive_api_requests.cc b/google_apis/drive/drive_api_requests.cc
index 79ef01a34430fc07e8d992d44205b3696976572e..ae5b54f927861ac46e8d2377add874fcdc025e91 100644
--- a/google_apis/drive/drive_api_requests.cc
+++ b/google_apis/drive/drive_api_requests.cc
@@ -153,6 +153,29 @@ GURL FilesGetRequest::GetURLInternal() const {
return url_generator_.GetFilesGetUrl(file_id_);
}
+//============================ FilesAuthorizeRequest ===========================
+
+FilesAuthorizeRequest::FilesAuthorizeRequest(
+ RequestSender* sender,
+ const DriveApiUrlGenerator& url_generator,
+ const FileResourceCallback& callback)
+ : DriveApiDataRequest(
+ sender,
+ base::Bind(&ParseJsonAndRun<FileResource>, callback)),
+ url_generator_(url_generator) {
+ DCHECK(!callback.is_null());
+}
+
+FilesAuthorizeRequest::~FilesAuthorizeRequest() {}
+
+net::URLFetcher::RequestType FilesAuthorizeRequest::GetRequestType() const {
+ return net::URLFetcher::POST;
+}
+
+GURL FilesAuthorizeRequest::GetURLInternal() const {
+ return url_generator_.GetFilesAuthorizeUrl(file_id_, app_id_);
+}
+
//============================ FilesInsertRequest ============================
FilesInsertRequest::FilesInsertRequest(
« no previous file with comments | « google_apis/drive/drive_api_requests.h ('k') | google_apis/drive/drive_api_url_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698