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

Unified Diff: chrome/browser/banners/app_banner_data_fetcher.cc

Issue 1308533006: webapps: allow callers of icon downloader/selector to specify a minimum size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webapps-splashscreen-icon
Patch Set: Address review comments Created 5 years, 3 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: chrome/browser/banners/app_banner_data_fetcher.cc
diff --git a/chrome/browser/banners/app_banner_data_fetcher.cc b/chrome/browser/banners/app_banner_data_fetcher.cc
index 21e29df41b928b79dd8ce2651a5b76bef3fc8bcb..6be7d97f0c3b86c34886618d77ef6ae8d9d8401d 100644
--- a/chrome/browser/banners/app_banner_data_fetcher.cc
+++ b/chrome/browser/banners/app_banner_data_fetcher.cc
@@ -74,10 +74,12 @@ void AppBannerDataFetcher::SetTimeDeltaForTesting(int days) {
AppBannerDataFetcher::AppBannerDataFetcher(
content::WebContents* web_contents,
base::WeakPtr<Delegate> delegate,
- int ideal_icon_size_in_dp)
+ int ideal_icon_size_in_dp,
+ int minimum_icon_size_in_dp)
: WebContentsObserver(web_contents),
- ideal_icon_size_in_dp_(ideal_icon_size_in_dp),
weak_delegate_(delegate),
+ ideal_icon_size_in_dp_(ideal_icon_size_in_dp),
+ minimum_icon_size_in_dp_(minimum_icon_size_in_dp),
is_active_(false),
was_canceled_by_page_(false),
page_requested_prompt_(false),
@@ -320,6 +322,7 @@ void AppBannerDataFetcher::OnHasServiceWorker(
ManifestIconSelector::FindBestMatchingIcon(
web_app_data_.icons,
ideal_icon_size_in_dp_,
+ minimum_icon_size_in_dp_,
gfx::Screen::GetScreenFor(web_contents->GetNativeView()));
if (!FetchAppIcon(web_contents, icon_url)) {
@@ -334,6 +337,7 @@ bool AppBannerDataFetcher::FetchAppIcon(content::WebContents* web_contents,
web_contents,
icon_url,
ideal_icon_size_in_dp_,
+ minimum_icon_size_in_dp_,
base::Bind(&AppBannerDataFetcher::OnAppIconFetched,
this));
}

Powered by Google App Engine
This is Rietveld 408576698