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

Unified Diff: google_apis/drive/drive_api_url_generator.cc

Issue 1965963003: Use new API to download blobs from Google Drive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 9fddeb607ca9e662fae565e21f47ffe22ac26484..a2113d41463aa7c52632d159246561f9d20f7547 100644
--- a/google_apis/drive/drive_api_url_generator.cc
+++ b/google_apis/drive/drive_api_url_generator.cc
@@ -31,7 +31,7 @@ const char kDriveV2UploadNewFileUrl[] = "upload/drive/v2/files";
const char kDriveV2UploadExistingFileUrlPrefix[] = "upload/drive/v2/files/";
const char kDriveV2BatchUploadUrl[] = "upload/drive";
const char kDriveV2PermissionsUrlFormat[] = "drive/v2/files/%s/permissions";
-const char kDriveV2DownloadUrlFormat[] = "host/%s";
+const char kDriveV2DownloadUrlFormat[] = "drive/v2/files/%s?alt=media";
const char kDriveV2ThumbnailUrlFormat[] = "d/%s=w%d-h%d";
const char kDriveV2ThumbnailUrlWithCropFormat[] = "d/%s=w%d-h%d-c";
@@ -54,10 +54,8 @@ GURL AddMultipartUploadParam(const GURL& url) {
} // namespace
DriveApiUrlGenerator::DriveApiUrlGenerator(const GURL& base_url,
- const GURL& base_download_url,
const GURL& base_thumbnail_url)
: base_url_(base_url),
- base_download_url_(base_download_url),
base_thumbnail_url_(base_thumbnail_url) {
// Do nothing.
}
@@ -69,13 +67,6 @@ DriveApiUrlGenerator::~DriveApiUrlGenerator() {
const char DriveApiUrlGenerator::kBaseUrlForProduction[] =
"https://www.googleapis.com";
-const char DriveApiUrlGenerator::kBaseDownloadUrlForProduction[] =
-#if defined(GOOGLE_CHROME_BUILD) || defined(USE_OFFICIAL_GOOGLE_API_KEYS)
- "https://www.googledrive.com/p/";
-#else
- "https://www.googledrive.com";
-#endif
-
const char DriveApiUrlGenerator::kBaseThumbnailUrlForProduction[] =
"https://lh3.googleusercontent.com";
@@ -289,7 +280,7 @@ GURL DriveApiUrlGenerator::GetMultipartUploadExistingFileUrl(
GURL DriveApiUrlGenerator::GenerateDownloadFileUrl(
const std::string& resource_id) const {
- return base_download_url_.Resolve(base::StringPrintf(
+ return base_url_.Resolve(base::StringPrintf(
kDriveV2DownloadUrlFormat, net::EscapePath(resource_id).c_str()));
}
« 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