diff options
author | yawano <yawano@chromium.org> | 2015-05-11 03:58:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-11 10:58:30 +0000 |
commit | 547dcf23cd4b129b83bc6667f69bdac4843c2284 (patch) | |
tree | fb3afc73d7fae2d2b99b3ce171b3a38ed37e9719 /google_apis/drive/drive_api_url_generator.cc | |
parent | 4c0a51aeb774512d9f2560e84dfd2be0a0687018 (diff) | |
download | chromium_src-547dcf23cd4b129b83bc6667f69bdac4843c2284.zip chromium_src-547dcf23cd4b129b83bc6667f69bdac4843c2284.tar.gz chromium_src-547dcf23cd4b129b83bc6667f69bdac4843c2284.tar.bz2 |
Use cropped thumbnail in list thumbnail loader.
BUG=480679
TEST=manually tested as described in the issue; google_apis_unittests: DriveApiUrlGeneratorTest
Review URL: https://codereview.chromium.org/1125353003
Cr-Commit-Position: refs/heads/master@{#329139}
Diffstat (limited to 'google_apis/drive/drive_api_url_generator.cc')
-rw-r--r-- | google_apis/drive/drive_api_url_generator.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/google_apis/drive/drive_api_url_generator.cc b/google_apis/drive/drive_api_url_generator.cc index f2d36fa..b6632d7 100644 --- a/google_apis/drive/drive_api_url_generator.cc +++ b/google_apis/drive/drive_api_url_generator.cc @@ -283,10 +283,17 @@ GURL DriveApiUrlGenerator::GetPermissionsInsertUrl( GURL DriveApiUrlGenerator::GetThumbnailUrl(const std::string& resource_id, int width, - int height) const { - return base_download_url_.Resolve( + int height, + bool crop) const { + GURL url = base_download_url_.Resolve( base::StringPrintf(kDriveV2ThumbnailUrlFormat, net::EscapePath(resource_id).c_str(), width, height)); + + // crop is "false" by default. + if (crop) + url = net::AppendOrReplaceQueryParameter(url, "crop", "true"); + + return url; } GURL DriveApiUrlGenerator::GetBatchUploadUrl() const { |