summaryrefslogtreecommitdiffstats
path: root/chrome/browser/icon_loader_linux.cc
diff options
context:
space:
mode:
authorsail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-08 21:26:30 +0000
committersail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-08 21:26:30 +0000
commit955c37b9e82a42ef09c8858bd1ab13f924881036 (patch)
treea41a404ec9c4d5fec0a9775d3b57f4ba5858d90b /chrome/browser/icon_loader_linux.cc
parent954bb26d39309023f7b41eb21e7d6c78f9abeb35 (diff)
downloadchromium_src-955c37b9e82a42ef09c8858bd1ab13f924881036.zip
chromium_src-955c37b9e82a42ef09c8858bd1ab13f924881036.tar.gz
chromium_src-955c37b9e82a42ef09c8858bd1ab13f924881036.tar.bz2
Mac: Fix icons in download dom UI
Icons in the download DOM UI were very fuzzy. This was a regression due to r76743. The problem was that IconLoad was returning a multi-resolution image but callers weren't multi-resolution aware. For example, the download DOM UI would encode the image to PNG but it would just pick the first bitmap which happened to be 16x16. This caused icons in the DOM UI to look fuzzy. I think there are two fixes for this: 1. Change IconLoader so that callers no longer specify the icon size. Instead, callers must pick the right resolution when they get the icon loaded callback. 2. Have callers specify that they want all resolutions. I went with 2 because always loading all icon sizes can be expensive. BUG=84741 TEST=Ran and verified that the downloads UI looks good. Review URL: http://codereview.chromium.org/6995068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88406 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/icon_loader_linux.cc')
-rw-r--r--chrome/browser/icon_loader_linux.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/chrome/browser/icon_loader_linux.cc b/chrome/browser/icon_loader_linux.cc
index ce8eade..c5b0423 100644
--- a/chrome/browser/icon_loader_linux.cc
+++ b/chrome/browser/icon_loader_linux.cc
@@ -16,12 +16,20 @@
#include "base/string_util.h"
static int SizeToInt(IconLoader::IconSize size) {
- int pixels = 48;
- if (size == IconLoader::NORMAL)
- pixels = 32;
- else if (size == IconLoader::SMALL)
- pixels = 16;
-
+ int pixels = 0;
+ switch (size) {
+ case IconLoader::SMALL:
+ pixels = 16;
+ break;
+ case IconLoader::NORMAL:
+ pixels = 32;
+ break;
+ case IconLoader::LARGE:
+ pixels = 48;
+ break;
+ default:
+ NOTREACHED();
+ }
return pixels;
}