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

Unified Diff: chrome/browser/ui/views/avatar_menu_button.cc

Issue 8141005: Multi-profile: Fix the avatar menu button on the windows taskbar (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/avatar_menu_button.cc
===================================================================
--- chrome/browser/ui/views/avatar_menu_button.cc (revision 104182)
+++ chrome/browser/ui/views/avatar_menu_button.cc (working copy)
@@ -47,9 +47,21 @@
return;
HICON icon = NULL;
if (bitmap) {
- // Since the target size is so small, we use our best resizer.
+ const SkBitmap* source_bitmap = NULL;
+ SkBitmap squarer_bitmap;
+ if ((bitmap->width() == 38) && (bitmap->height() == 31)) {
+ // Shave a couple of columns so the bitmap is more square. So when
+ // resized to a square aspect ratio it looks pretty.
+ bitmap->extractSubset(&squarer_bitmap, SkIRect::MakeXYWH(2, 0, 34, 31));
+ source_bitmap = &squarer_bitmap;
+ } else {
+ // The bitmaps size has changed. Resize what we have.
+ source_bitmap = bitmap;
+ }
+ // Since the target size is so small, we use our best resizer. Never pass
+ // windows a different size because it will badly hammer it to 16x16.
SkBitmap sk_icon = skia::ImageOperations::Resize(
- *bitmap,
+ *source_bitmap,
skia::ImageOperations::RESIZE_LANCZOS3,
16, 16);
icon = IconUtil::CreateHICONFromSkBitmap(sk_icon);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698