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

Unified Diff: chrome/browser/manifest/manifest_icon_downloader.cc

Issue 2589503002: Use exact pixel sizes instead of dip in webapp/WebAPK installability code (Closed)
Patch Set: Merge branch 'master' into dp_px Created 4 years 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 4b208cc54287eed44614c3dd740dd2c1caa4bbc0..b3a7c6b4f658e57e354d423555f926791967e89a 100644
--- a/chrome/browser/manifest/manifest_icon_downloader.cc
+++ b/chrome/browser/manifest/manifest_icon_downloader.cc
@@ -15,8 +15,6 @@
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/console_message_level.h"
#include "skia/ext/image_operations.h"
-#include "ui/display/display.h"
-#include "ui/display/screen.h"
// DevToolsConsoleHelper is a class that holds a WebContents in order to be able
// to send a message to the WebContents' main frame. It is used so
@@ -49,20 +47,13 @@ void ManifestIconDownloader::DevToolsConsoleHelper::AddMessage(
bool ManifestIconDownloader::Download(
content::WebContents* web_contents,
const GURL& icon_url,
- int ideal_icon_size_in_dp,
- int minimum_icon_size_in_dp,
+ int ideal_icon_size_in_px,
+ int minimum_icon_size_in_px,
const ManifestIconDownloader::IconFetchCallback& callback) {
- DCHECK(minimum_icon_size_in_dp <= ideal_icon_size_in_dp);
+ DCHECK(minimum_icon_size_in_px <= ideal_icon_size_in_px);
if (!web_contents || !icon_url.is_valid())
return false;
- const float device_scale_factor =
- display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor();
- const int ideal_icon_size_in_px =
- static_cast<int>(round(ideal_icon_size_in_dp * device_scale_factor));
- const int minimum_icon_size_in_px =
- static_cast<int>(round(minimum_icon_size_in_dp * device_scale_factor));
-
web_contents->DownloadImage(
icon_url,
false, // is_favicon
« no previous file with comments | « chrome/browser/manifest/manifest_icon_downloader.h ('k') | chrome/browser/manifest/manifest_icon_selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698