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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
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 #include "google_apis/drive/drive_api_requests.h" 5 #include "google_apis/drive/drive_api_requests.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 url_generator_(url_generator) { 146 url_generator_(url_generator) {
147 DCHECK(!callback.is_null()); 147 DCHECK(!callback.is_null());
148 } 148 }
149 149
150 FilesGetRequest::~FilesGetRequest() {} 150 FilesGetRequest::~FilesGetRequest() {}
151 151
152 GURL FilesGetRequest::GetURLInternal() const { 152 GURL FilesGetRequest::GetURLInternal() const {
153 return url_generator_.GetFilesGetUrl(file_id_); 153 return url_generator_.GetFilesGetUrl(file_id_);
154 } 154 }
155 155
156 //============================ FilesAuthorizeRequest ===========================
157
158 FilesAuthorizeRequest::FilesAuthorizeRequest(
159 RequestSender* sender,
160 const DriveApiUrlGenerator& url_generator,
161 const FileResourceCallback& callback)
162 : DriveApiDataRequest(
163 sender,
164 base::Bind(&ParseJsonAndRun<FileResource>, callback)),
165 url_generator_(url_generator) {
166 DCHECK(!callback.is_null());
167 }
168
169 FilesAuthorizeRequest::~FilesAuthorizeRequest() {}
170
171 net::URLFetcher::RequestType FilesAuthorizeRequest::GetRequestType() const {
172 return net::URLFetcher::POST;
173 }
174
175 GURL FilesAuthorizeRequest::GetURLInternal() const {
176 return url_generator_.GetFilesAuthorizeUrl(file_id_, app_id_);
177 }
178
156 //============================ FilesInsertRequest ============================ 179 //============================ FilesInsertRequest ============================
157 180
158 FilesInsertRequest::FilesInsertRequest( 181 FilesInsertRequest::FilesInsertRequest(
159 RequestSender* sender, 182 RequestSender* sender,
160 const DriveApiUrlGenerator& url_generator, 183 const DriveApiUrlGenerator& url_generator,
161 const FileResourceCallback& callback) 184 const FileResourceCallback& callback)
162 : DriveApiDataRequest( 185 : DriveApiDataRequest(
163 sender, 186 sender,
164 base::Bind(&ParseJsonAndRun<FileResource>, callback)), 187 base::Bind(&ParseJsonAndRun<FileResource>, callback)),
165 url_generator_(url_generator) { 188 url_generator_(url_generator) {
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 progress_callback, 777 progress_callback,
755 url_generator.GenerateDownloadFileUrl(resource_id), 778 url_generator.GenerateDownloadFileUrl(resource_id),
756 output_file_path) { 779 output_file_path) {
757 } 780 }
758 781
759 DownloadFileRequest::~DownloadFileRequest() { 782 DownloadFileRequest::~DownloadFileRequest() {
760 } 783 }
761 784
762 } // namespace drive 785 } // namespace drive
763 } // namespace google_apis 786 } // namespace google_apis
OLDNEW
« 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