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

Unified Diff: chrome/browser/win/jumplist.cc

Issue 2665623002: Fix Jumplist favicons to have high resolution in HDPI Windows displays (Closed)
Patch Set: Update comments and remove redundant .h files. Created 3 years, 11 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
« no previous file with comments | « no previous file | ui/display/win/screen_win.h » ('j') | ui/display/win/screen_win.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/win/jumplist.cc
diff --git a/chrome/browser/win/jumplist.cc b/chrome/browser/win/jumplist.cc
index 508093dfa290fa460552fa29d95bdf17c8b071eb..a84f4a717a34f2a597254b788c5564694a8b303d 100644
--- a/chrome/browser/win/jumplist.cc
+++ b/chrome/browser/win/jumplist.cc
@@ -41,6 +41,7 @@
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_source.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/display/win/screen_win.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/favicon_size.h"
#include "ui/gfx/icon_util.h"
@@ -541,10 +542,16 @@ void JumpList::OnFaviconDataAvailable(
base::AutoLock auto_lock(data->list_lock_);
// Attach the received data to the ShellLinkItem object.
// This data will be decoded by the RunUpdateOnFileThread method.
- if (!image_result.image.IsEmpty()) {
- if (!data->icon_urls_.empty() && data->icon_urls_.front().second.get())
+ if (!image_result.image.IsEmpty() && !data->icon_urls_.empty() &&
+ data->icon_urls_.front().second.get()) {
+ float scale = display::win::ScreenWin::GetLargestDeviceScaleFactor();
+ if (scale > 1.0) {
+ data->icon_urls_.front().second->set_icon_data(
+ image_result.image.AsBitmap2x());
+ } else {
data->icon_urls_.front().second->set_icon_data(
image_result.image.AsBitmap());
+ }
}
if (!data->icon_urls_.empty())
« no previous file with comments | « no previous file | ui/display/win/screen_win.h » ('j') | ui/display/win/screen_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698