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

Unified Diff: chrome/browser/android/banners/app_banner_data_fetcher_android.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: Fix test failure 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/android/banners/app_banner_data_fetcher_android.cc
diff --git a/chrome/browser/android/banners/app_banner_data_fetcher_android.cc b/chrome/browser/android/banners/app_banner_data_fetcher_android.cc
index d18eb59f058d297612600e3c46a6fb644af42965..b8a561d1dd000383d4e7601058efc1094966d9c0 100644
--- a/chrome/browser/android/banners/app_banner_data_fetcher_android.cc
+++ b/chrome/browser/android/banners/app_banner_data_fetcher_android.cc
@@ -18,10 +18,16 @@ namespace banners {
AppBannerDataFetcherAndroid::AppBannerDataFetcherAndroid(
content::WebContents* web_contents,
base::WeakPtr<Delegate> weak_delegate,
+ int ideal_icon_size_in_dp,
+ int minimum_icon_size_in_dp,
int ideal_splash_image_size_in_dp,
- int ideal_icon_size_in_dp)
- : AppBannerDataFetcher(web_contents, weak_delegate, ideal_icon_size_in_dp),
- ideal_splash_image_size_in_dp_(ideal_splash_image_size_in_dp) {
+ int minimum_splash_image_size_in_dp)
+ : AppBannerDataFetcher(web_contents,
+ weak_delegate,
+ ideal_icon_size_in_dp,
+ minimum_icon_size_in_dp),
+ ideal_splash_image_size_in_dp_(ideal_splash_image_size_in_dp),
+ minimum_splash_image_size_in_dp_(minimum_splash_image_size_in_dp) {
}
AppBannerDataFetcherAndroid::~AppBannerDataFetcherAndroid() {
@@ -56,10 +62,15 @@ void AppBannerDataFetcherAndroid::FetchWebappSplashScreenImage(
GURL image_url = ManifestIconSelector::FindBestMatchingIcon(
web_app_data().icons,
ideal_splash_image_size_in_dp_,
+ minimum_splash_image_size_in_dp_,
gfx::Screen::GetScreenFor(web_contents->GetNativeView()));
ShortcutHelper::FetchSplashScreenImage(
- web_contents, image_url, ideal_splash_image_size_in_dp_, webapp_id);
+ web_contents,
+ image_url,
+ ideal_splash_image_size_in_dp_,
+ minimum_splash_image_size_in_dp_,
+ webapp_id);
}
void AppBannerDataFetcherAndroid::ShowBanner(const SkBitmap* icon,

Powered by Google App Engine
This is Rietveld 408576698