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

Unified Diff: chrome/browser/ui/app_list/search/launcher_search/extension_badged_icon_image_impl.cc

Issue 1153063009: Supports high dpi devices in custom icon of launcher search result. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move badge_size to Draw(). Created 5 years, 6 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/ui/app_list/search/launcher_search/extension_badged_icon_image.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/search/launcher_search/extension_badged_icon_image_impl.cc
diff --git a/chrome/browser/ui/app_list/search/launcher_search/extension_badged_icon_image_impl.cc b/chrome/browser/ui/app_list/search/launcher_search/extension_badged_icon_image_impl.cc
index 71caf5742e87402db8198e4219f83718af7ac583..496b8da3de35b7119dd90683ff908bdb962f8169 100644
--- a/chrome/browser/ui/app_list/search/launcher_search/extension_badged_icon_image_impl.cc
+++ b/chrome/browser/ui/app_list/search/launcher_search/extension_badged_icon_image_impl.cc
@@ -43,11 +43,14 @@ void ExtensionBadgedIconImageImpl::LoadIconResourceFromExtension() {
const extensions::ExtensionResource& resource =
extension_->GetResource(file_path);
- // Load image with ImageLoader. ImageLoader resizes image to |icon_size_|.
+ // Load image as scale factor 2.0. Resizing image to proper size depending on
+ // DPI is done in BadgedIconSource.
std::vector<extensions::ImageLoader::ImageRepresentation> info_list;
info_list.push_back(extensions::ImageLoader::ImageRepresentation(
- resource, extensions::ImageLoader::ImageRepresentation::ALWAYS_RESIZE,
- icon_size_, ui::SCALE_FACTOR_100P));
+ resource,
+ extensions::ImageLoader::ImageRepresentation::RESIZE_WHEN_LARGER,
+ gfx::Size(icon_size_.width() * 2, icon_size_.height() * 2),
+ ui::SCALE_FACTOR_200P));
extensions::ImageLoader::Get(profile_)->LoadImagesAsync(
extension_, info_list,
base::Bind(&ExtensionBadgedIconImageImpl::OnCustomIconImageLoaded,
« no previous file with comments | « chrome/browser/ui/app_list/search/launcher_search/extension_badged_icon_image.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698