diff options
author | hashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-17 07:25:42 +0000 |
---|---|---|
committer | hashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-17 07:25:42 +0000 |
commit | 54facd633172b6d39c4f22edd9b976a39f468c45 (patch) | |
tree | c66e3d287dc23ab4084fd0a9ccb97d5078eed479 /google_apis/drive/drive_api_url_generator.cc | |
parent | 9bd35ea58e998fd1405579c61e06fe23225a0aa9 (diff) | |
download | chromium_src-54facd633172b6d39c4f22edd9b976a39f468c45.zip chromium_src-54facd633172b6d39c4f22edd9b976a39f468c45.tar.gz chromium_src-54facd633172b6d39c4f22edd9b976a39f468c45.tar.bz2 |
drive: Add metadata parameters to InitiateUpload* methods
It is allowed to send metadata and file contents at the same time with Drive API.
BUG=260539
TEST=unit_tests
Review URL: https://codereview.chromium.org/139153006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245466 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'google_apis/drive/drive_api_url_generator.cc')
-rw-r--r-- | google_apis/drive/drive_api_url_generator.cc | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/google_apis/drive/drive_api_url_generator.cc b/google_apis/drive/drive_api_url_generator.cc index e9d89d2..275a348 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( |