| Index: components/favicon/core/favicon_handler.cc
|
| diff --git a/components/favicon/core/favicon_handler.cc b/components/favicon/core/favicon_handler.cc
|
| index 7812b52217b51e2a7cdd8f45b7d0135c3d6f9850..46d62352af41e15e8745eee07689984707dcc338 100644
|
| --- a/components/favicon/core/favicon_handler.cc
|
| +++ b/components/favicon/core/favicon_handler.cc
|
| @@ -27,7 +27,12 @@
|
| namespace favicon {
|
| namespace {
|
|
|
| -const int kLargestIconSize = 192;
|
| +const int kNonTouchLargestIconSize = 192;
|
| +
|
| +// Size (along each axis) of a touch icon. This currently corresponds to
|
| +// the apple touch icon for iPad.
|
| +// TODO(crbug.com/736290): Consider changing this to 192x192 for Android.
|
| +const int kTouchIconSize = 144;
|
|
|
| // Return true if |bitmap_result| is expired.
|
| bool IsExpired(const favicon_base::FaviconRawBitmapResult& bitmap_result) {
|
| @@ -131,8 +136,9 @@
|
| return pixel_sizes;
|
| }
|
| case FaviconDriverObserver::NON_TOUCH_LARGEST:
|
| + return std::vector<int>(1U, kNonTouchLargestIconSize);
|
| case FaviconDriverObserver::TOUCH_LARGEST:
|
| - return std::vector<int>(1U, kLargestIconSize);
|
| + return std::vector<int>(1U, kTouchIconSize);
|
| }
|
| NOTREACHED();
|
| return std::vector<int>();
|
| @@ -342,7 +348,8 @@
|
|
|
| // If no manifest available, proceed with the regular candidates only.
|
| if (manifest_url_.is_empty()) {
|
| - OnGotFinalIconURLCandidates(candidates);
|
| + OnGotFinalIconURLCandidates(candidates,
|
| + GetDesiredPixelSizes(handler_type_));
|
| return;
|
| }
|
|
|
| @@ -391,7 +398,9 @@
|
| manifest_download_request_.Cancel();
|
|
|
| if (!candidates.empty()) {
|
| - OnGotFinalIconURLCandidates(candidates);
|
| + // When reading icons from web manifests, prefer kNonTouchLargestIconSize.
|
| + OnGotFinalIconURLCandidates(candidates,
|
| + std::vector<int>(1U, kNonTouchLargestIconSize));
|
| return;
|
| }
|
|
|
| @@ -404,14 +413,13 @@
|
| service_->UnableToDownloadFavicon(manifest_url_);
|
| manifest_url_ = GURL();
|
|
|
| - OnGotFinalIconURLCandidates(non_manifest_original_candidates_);
|
| + OnGotFinalIconURLCandidates(non_manifest_original_candidates_,
|
| + GetDesiredPixelSizes(handler_type_));
|
| }
|
|
|
| void FaviconHandler::OnGotFinalIconURLCandidates(
|
| - const std::vector<FaviconURL>& candidates) {
|
| - const std::vector<int> desired_pixel_sizes =
|
| - GetDesiredPixelSizes(handler_type_);
|
| -
|
| + const std::vector<FaviconURL>& candidates,
|
| + const std::vector<int>& desired_pixel_sizes) {
|
| std::vector<FaviconCandidate> sorted_candidates;
|
| for (const FaviconURL& candidate : candidates) {
|
| if (!candidate.icon_url.is_empty() && (candidate.icon_type & icon_types_)) {
|
|
|