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

Unified Diff: components/favicon/core/favicon_handler.cc

Issue 2948963002: Prefer 192x192 icons from Web Manifests instead of 144x144 (Closed)
Patch Set: Created 3 years, 6 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
Index: components/favicon/core/favicon_handler.cc
diff --git a/components/favicon/core/favicon_handler.cc b/components/favicon/core/favicon_handler.cc
index aa57bfcd22f5e82542c6d7702766416ef0b69923..c94b6268cf54fa5a4c07c014380e1adcb0d02e6e 100644
--- a/components/favicon/core/favicon_handler.cc
+++ b/components/favicon/core/favicon_handler.cc
@@ -347,7 +347,8 @@ void FaviconHandler::OnUpdateCandidates(
// If no manifest available, proceed with the regular candidates only.
if (manifest_url_.is_empty()) {
- OnGotFinalIconURLCandidates(candidates);
+ OnGotFinalIconURLCandidates(candidates,
+ GetDesiredPixelSizes(handler_type_));
return;
}
@@ -396,7 +397,9 @@ void FaviconHandler::OnDidDownloadManifest(
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;
}
@@ -409,14 +412,14 @@ void FaviconHandler::OnDidDownloadManifest(
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<FaviconURL>& candidates,
+ const std::vector<int>& desired_pixel_sizes) {
std::vector<FaviconCandidate> sorted_candidates;
- const std::vector<int> desired_pixel_sizes =
- GetDesiredPixelSizes(handler_type_);
for (const FaviconURL& candidate : candidates) {
if (!candidate.icon_url.is_empty() && (candidate.icon_type & icon_types_)) {
sorted_candidates.push_back(

Powered by Google App Engine
This is Rietveld 408576698