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

Unified Diff: google_apis/drive/drive_api_url_generator.cc

Issue 139153006: drive: Add metadata parameters to InitiateUpload* methods (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nits 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_url_generator.h ('k') | google_apis/drive/drive_api_url_generator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/drive/drive_api_url_generator.cc
diff --git a/google_apis/drive/drive_api_url_generator.cc b/google_apis/drive/drive_api_url_generator.cc
index e9d89d25d55a7851d2092674c4d36bc632807a40..275a348a05b095ce5370288854ad6e7122b56dac 100644
--- a/google_apis/drive/drive_api_url_generator.cc
+++ b/google_apis/drive/drive_api_url_generator.cc
@@ -170,17 +170,31 @@ GURL DriveApiUrlGenerator::GetChildrenDeleteUrl(
net::EscapePath(child_id).c_str()));
}
-GURL DriveApiUrlGenerator::GetInitiateUploadNewFileUrl() const {
- return AddResumableUploadParam(
+GURL DriveApiUrlGenerator::GetInitiateUploadNewFileUrl(
+ bool set_modified_date) const {
+ GURL url = AddResumableUploadParam(
base_url_.Resolve(kDriveV2InitiateUploadNewFileUrl));
+
+ // setModifiedDate is "false" by default.
+ if (set_modified_date)
+ url = net::AppendOrReplaceQueryParameter(url, "setModifiedDate", "true");
+
+ return url;
}
GURL DriveApiUrlGenerator::GetInitiateUploadExistingFileUrl(
- const std::string& resource_id) const {
- const GURL& url = base_url_.Resolve(
+ const std::string& resource_id,
+ bool set_modified_date) const {
+ GURL url = base_url_.Resolve(
kDriveV2InitiateUploadExistingFileUrlPrefix +
net::EscapePath(resource_id));
- return AddResumableUploadParam(url);
+ url = AddResumableUploadParam(url);
+
+ // setModifiedDate is "false" by default.
+ if (set_modified_date)
+ url = net::AppendOrReplaceQueryParameter(url, "setModifiedDate", "true");
+
+ return url;
}
GURL DriveApiUrlGenerator::GenerateDownloadFileUrl(
« no previous file with comments | « google_apis/drive/drive_api_url_generator.h ('k') | google_apis/drive/drive_api_url_generator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698