Commit 14a1d635 authored by Jan Krcal's avatar Jan Krcal Committed by Commit Bot

[LargeIcon] Clean up producing request urls for Google Server

This CL cleans up a minor weirdness in the code I've randomly run into.
The CL introduces no behavioral differences.

Bug: none
Change-Id: I72c8306e948c20e2e5c67ac34a6465912cfa64c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1812817
Commit-Queue: Jan Krcal <jkrcal@chromium.org>
Auto-Submit: Jan Krcal <jkrcal@chromium.org>
Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697974}
parent 8ff97a7c
......@@ -39,11 +39,9 @@ using favicon_base::GoogleFaviconServerRequestStatus;
const char kImageFetcherUmaClient[] = "LargeIconService";
const char kGoogleServerV2RequestFormat[] =
"https://t0.gstatic.com/faviconV2?client=chrome&nfrp=2&%s"
"https://t0.gstatic.com/faviconV2?client=%s&nfrp=2&%s"
"size=%d&min_size=%d&max_size=%d&fallback_opts=TYPE,SIZE,URL&url=%s";
const char kClientParam[] = "client=chrome";
const char kCheckSeenParam[] = "check_seen=true&";
const int kGoogleServerV2EnforcedMinSizeInPixel = 16;
......@@ -82,13 +80,10 @@ GURL GetRequestUrlForGoogleServerV2(
std::max(max_size_in_pixel, kGoogleServerV2MinimumMaxSizeInPixel);
std::string request_url = base::StringPrintf(
kGoogleServerV2RequestFormat,
kGoogleServerV2RequestFormat, google_server_client_param.c_str(),
may_page_url_be_private ? kCheckSeenParam : "", desired_size_in_pixel,
kGoogleServerV2EnforcedMinSizeInPixel, max_size_in_pixel,
page_url.spec().c_str());
base::ReplaceFirstSubstringAfterOffset(
&request_url, 0, std::string(kClientParam),
"client=" + google_server_client_param);
return GURL(request_url);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment