Chromium Code Reviews| Index: components/favicon/core/large_icon_service.cc |
| diff --git a/components/favicon/core/large_icon_service.cc b/components/favicon/core/large_icon_service.cc |
| index 387f5a714ac5fd70fa3459c25609609ee6ccd1f5..df9f2e32e5a1db688c0f269cb33f14789e74bf9e 100644 |
| --- a/components/favicon/core/large_icon_service.cc |
| +++ b/components/favicon/core/large_icon_service.cc |
| @@ -40,10 +40,12 @@ const base::Feature kLargeIconServiceFetchingFeature{ |
| const char kGoogleServerV2RequestFormat[] = |
| "https://t0.gstatic.com/faviconV2?" |
| - "client=chrome&drop_404_icon=true&check_seen=true&" |
| + "client=chrome&drop_404_icon=true&%s" |
| "size=%d&min_size=%d&max_size=%d&fallback_opts=TYPE,SIZE,URL&url=%s"; |
| const char kGoogleServerV2RequestFormatParam[] = "request_format"; |
| +const char kCheckSeenParam[] = "check_seen=true&"; |
|
pkotwicz
2017/05/24 05:02:25
Random question: Does "check_seen=false" work?
jkrcal
2017/05/24 08:54:48
Yes. Any non-"true" value of check_seen is equival
|
| + |
| const int kGoogleServerV2EnforcedMinSizeInPixel = 32; |
| const char kGoogleServerV2EnforcedMinSizeInPixelParam[] = |
| "enforced_min_size_in_pixel"; |
| @@ -66,7 +68,8 @@ GURL TrimPageUrlForGoogleServer(const GURL& page_url) { |
| GURL GetRequestUrlForGoogleServerV2(const GURL& page_url, |
| int min_source_size_in_pixel, |
| - int desired_size_in_pixel) { |
| + int desired_size_in_pixel, |
| + bool may_page_url_be_private) { |
| std::string url_format = base::GetFieldTrialParamValueByFeature( |
| kLargeIconServiceFetchingFeature, kGoogleServerV2RequestFormatParam); |
| double desired_to_max_size_factor = base::GetFieldTrialParamByFeatureAsDouble( |
| @@ -86,8 +89,8 @@ GURL GetRequestUrlForGoogleServerV2(const GURL& page_url, |
| return GURL(base::StringPrintf( |
| url_format.empty() ? kGoogleServerV2RequestFormat : url_format.c_str(), |
| - desired_size_in_pixel, min_source_size_in_pixel, max_size_in_pixel, |
| - page_url.spec().c_str())); |
| + may_page_url_be_private ? kCheckSeenParam : "", desired_size_in_pixel, |
| + min_source_size_in_pixel, max_size_in_pixel, page_url.spec().c_str())); |
| } |
| bool IsDbResultAdequate(const favicon_base::FaviconRawBitmapResult& db_result, |
| @@ -345,12 +348,14 @@ void LargeIconService:: |
| const GURL& page_url, |
| int min_source_size_in_pixel, |
| int desired_size_in_pixel, |
| + bool may_page_url_be_private, |
| const base::Callback<void(bool success)>& callback) { |
| DCHECK_LE(0, min_source_size_in_pixel); |
| const GURL trimmed_page_url = TrimPageUrlForGoogleServer(page_url); |
| const GURL server_request_url = GetRequestUrlForGoogleServerV2( |
| - trimmed_page_url, min_source_size_in_pixel, desired_size_in_pixel); |
| + trimmed_page_url, min_source_size_in_pixel, desired_size_in_pixel, |
| + may_page_url_be_private); |
| // Do not download if the URL is invalid after trimming, or there is a |
| // previous cache miss recorded for |server_request_url|. |