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

Unified Diff: chrome/browser/manifest/manifest_icon_downloader.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 non-compiling test 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/manifest/manifest_icon_downloader.cc
diff --git a/chrome/browser/manifest/manifest_icon_downloader.cc b/chrome/browser/manifest/manifest_icon_downloader.cc
index 5746a52507484788fb3f40bb0cc1b441f78f29fb..e1e8f4e3203b4ec15ad6cc5fe65ee4db9bd4db2d 100644
--- a/chrome/browser/manifest/manifest_icon_downloader.cc
+++ b/chrome/browser/manifest/manifest_icon_downloader.cc
@@ -16,6 +16,7 @@ bool ManifestIconDownloader::Download(
content::WebContents* web_contents,
const GURL& icon_url,
int ideal_icon_size_in_dp,
+ int minimum_icon_size_in_dp,
const ManifestIconDownloader::IconFetchCallback& callback) {
if (!web_contents || !icon_url.is_valid())
return false;
@@ -27,11 +28,8 @@ bool ManifestIconDownloader::Download(
screen->GetPrimaryDisplay().device_scale_factor();
const float ideal_icon_size_in_px =
ideal_icon_size_in_dp * device_scale_factor;
-
- const int minimum_scale_factor = std::max(
- static_cast<int>(floor(device_scale_factor - 1)), 1);
const float minimum_icon_size_in_px =
- ideal_icon_size_in_dp * minimum_scale_factor;
+ minimum_icon_size_in_dp * device_scale_factor;
web_contents->DownloadImage(
icon_url,

Powered by Google App Engine
This is Rietveld 408576698