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

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

Issue 2883293002: LargeIconService returns icon of the desired size (Closed)
Patch Set: Add comment and change the logic of the min size Created 3 years, 7 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/large_icon_service.cc
diff --git a/components/favicon/core/large_icon_service.cc b/components/favicon/core/large_icon_service.cc
index 8920f7c49631db6cefd1240e1bfe3ef6a50accaf..75a9dd8cc516ae074fb8f078c345dda25c85e365 100644
--- a/components/favicon/core/large_icon_service.cc
+++ b/components/favicon/core/large_icon_service.cc
@@ -385,12 +385,14 @@ LargeIconService::GetLargeIconOrFallbackStyleImpl(
min_source_size_in_pixel, desired_size_in_pixel, raw_bitmap_callback,
image_callback, background_task_runner_, tracker);
+ int max_size_in_pixel =
+ std::max(desired_size_in_pixel, min_source_size_in_pixel);
// TODO(beaudoin): For now this is just a wrapper around
// GetLargestRawFaviconForPageURL. Add the logic required to select the best
// possible large icon. Also add logic to fetch-on-demand when the URL of
// a large icon is known but its bitmap is not available.
return favicon_service_->GetLargestRawFaviconForPageURL(
- page_url, large_icon_types_, min_source_size_in_pixel,
+ page_url, large_icon_types_, max_size_in_pixel,
jkrcal 2017/05/18 12:33:55 nit: I do not like the naming. Passing in a max_si
gambard 2017/05/18 13:43:59 I don't like changing the value of arguments. but
jkrcal 2017/05/18 13:50:59 I see. ideal is better to me than max. Maybe size_
base::Bind(&LargeIconWorker::OnIconLookupComplete, worker), tracker);
}
« components/favicon/core/large_icon_service.h ('K') | « components/favicon/core/large_icon_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698