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 #include "chrome/browser/google_apis/drive_api_operations.h" | 5 #include "chrome/browser/google_apis/drive_api_operations.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/values.h" | 10 #include "base/values.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 directory_name_(directory_name) { | 193 directory_name_(directory_name) { |
194 DCHECK(!callback.is_null()); | 194 DCHECK(!callback.is_null()); |
195 } | 195 } |
196 | 196 |
197 CreateDirectoryOperation::~CreateDirectoryOperation() {} | 197 CreateDirectoryOperation::~CreateDirectoryOperation() {} |
198 | 198 |
199 GURL CreateDirectoryOperation::GetURL() const { | 199 GURL CreateDirectoryOperation::GetURL() const { |
200 if (parent_resource_id_.empty() || directory_name_.empty()) { | 200 if (parent_resource_id_.empty() || directory_name_.empty()) { |
201 return GURL(); | 201 return GURL(); |
202 } | 202 } |
203 return url_generator_.GetFilelistUrl(GURL(), ""); | 203 return url_generator_.GetFilelistUrl(GURL(), std::string()); |
204 } | 204 } |
205 | 205 |
206 net::URLFetcher::RequestType CreateDirectoryOperation::GetRequestType() const { | 206 net::URLFetcher::RequestType CreateDirectoryOperation::GetRequestType() const { |
207 return net::URLFetcher::POST; | 207 return net::URLFetcher::POST; |
208 } | 208 } |
209 | 209 |
210 bool CreateDirectoryOperation::GetContentData(std::string* upload_content_type, | 210 bool CreateDirectoryOperation::GetContentData(std::string* upload_content_type, |
211 std::string* upload_content) { | 211 std::string* upload_content) { |
212 *upload_content_type = kContentTypeApplicationJson; | 212 *upload_content_type = kContentTypeApplicationJson; |
213 | 213 |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 | 539 |
540 ResumeUploadOperation::~ResumeUploadOperation() {} | 540 ResumeUploadOperation::~ResumeUploadOperation() {} |
541 | 541 |
542 void ResumeUploadOperation::OnRangeOperationComplete( | 542 void ResumeUploadOperation::OnRangeOperationComplete( |
543 const UploadRangeResponse& response, scoped_ptr<base::Value> value) { | 543 const UploadRangeResponse& response, scoped_ptr<base::Value> value) { |
544 ParseFileResourceWithUploadRangeAndRun(callback_, response, value.Pass()); | 544 ParseFileResourceWithUploadRangeAndRun(callback_, response, value.Pass()); |
545 } | 545 } |
546 | 546 |
547 } // namespace drive | 547 } // namespace drive |
548 } // namespace google_apis | 548 } // namespace google_apis |
OLD | NEW |