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

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

Issue 2665623002: Fix Jumplist favicons to have high resolution in HDPI Windows displays (Closed)
Patch Set: 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 | « chrome/browser/win/jumplist.h ('k') | no next file » | no next file with comments »
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..c1370b4e0ed96fd9db490c50e7bcc97ab314eab1 100644
--- a/chrome/browser/win/jumplist.cc
+++ b/chrome/browser/win/jumplist.cc
@@ -522,14 +522,14 @@ void JumpList::StartLoadingFavicon() {
favicon::FaviconService* favicon_service =
FaviconServiceFactory::GetForProfile(profile_,
ServiceAccessType::EXPLICIT_ACCESS);
- task_id_ = favicon_service->GetFaviconImageForPageURL(
- url,
+ task_id_ = favicon_service->GetRawFaviconForPageURL(
+ url, favicon_base::FAVICON, 0,
sky 2017/01/30 23:56:11 Supplying 0 for a size may result in a large sized
chengx 2017/01/31 00:39:38 The original API, i.e., GetFaviconImageForPageURL,
base::Bind(&JumpList::OnFaviconDataAvailable, base::Unretained(this)),
&cancelable_task_tracker_);
}
void JumpList::OnFaviconDataAvailable(
- const favicon_base::FaviconImageResult& image_result) {
+ const favicon_base::FaviconRawBitmapResult& image_result) {
DCHECK(CalledOnValidThread());
// If there is currently a favicon request in progress, it is now outdated,
@@ -541,10 +541,11 @@ 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 (image_result.is_valid()) {
if (!data->icon_urls_.empty() && data->icon_urls_.front().second.get())
data->icon_urls_.front().second->set_icon_data(
- image_result.image.AsBitmap());
+ gfx::Image::CreateFrom1xPNGBytes(image_result.bitmap_data)
grt (UTC plus 2) 2017/01/30 10:02:40 Is it necessarily the case that the favicon bitmap
chengx 2017/01/31 00:39:38 Sure.
+ .AsBitmap());
}
if (!data->icon_urls_.empty())
« no previous file with comments | « chrome/browser/win/jumplist.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698