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

Unified Diff: chrome/browser/profiles/profile_shortcut_manager_win.cc

Issue 212603011: Newly created profiles should have the grey silhouette as avatar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactor parallel arrays; trungl's suggestions Created 6 years, 8 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
Index: chrome/browser/profiles/profile_shortcut_manager_win.cc
diff --git a/chrome/browser/profiles/profile_shortcut_manager_win.cc b/chrome/browser/profiles/profile_shortcut_manager_win.cc
index d7f1bebd2a6377551e4a422cbe0729a2dc8ef2be..f21dc92658ae8bab8af0b2083d9720e3584d4baa 100644
--- a/chrome/browser/profiles/profile_shortcut_manager_win.cc
+++ b/chrome/browser/profiles/profile_shortcut_manager_win.cc
@@ -103,6 +103,7 @@ const int kProfileAvatarIconResources2x[] = {
IDR_PROFILE_AVATAR_2X_23,
IDR_PROFILE_AVATAR_2X_24,
IDR_PROFILE_AVATAR_2X_25,
+ IDR_PROFILE_AVATAR_2X_26,
};
// Badges |app_icon_bitmap| with |avatar_bitmap| at the bottom right corner and
@@ -110,28 +111,18 @@ const int kProfileAvatarIconResources2x[] = {
SkBitmap BadgeIcon(const SkBitmap& app_icon_bitmap,
const SkBitmap& avatar_bitmap,
int scale_factor) {
- // TODO(rlp): Share this chunk of code with
- // avatar_menu_button::DrawTaskBarDecoration.
- SkBitmap source_bitmap = avatar_bitmap;
- if ((avatar_bitmap.width() == scale_factor * profiles::kAvatarIconWidth) &&
- (avatar_bitmap.height() == scale_factor * profiles::kAvatarIconHeight)) {
- // Shave a couple of columns so the bitmap is more square. So when
- // resized to a square aspect ratio it looks pretty.
- gfx::Rect frame(scale_factor * profiles::kAvatarIconWidth,
- scale_factor * profiles::kAvatarIconHeight);
- frame.Inset(scale_factor * 2, 0, scale_factor * 2, 0);
- avatar_bitmap.extractSubset(&source_bitmap, gfx::RectToSkIRect(frame));
- } else {
- NOTREACHED();
- }
+ // All icons, whether cartoon, GAIA or placeholder, should be square.
+ // TODO(mlerman) - uncomment the ASSERT once noms@ lands the square images.
+ // DLOG_ASSERT(avatar_bitmap.width() == avatar_bitmap.height());
noms (inactive) 2014/04/15 15:26:48 I think this should be, if anything, a DCHECK, not
Mike Lerman 2014/04/15 17:56:46 Done.
+
int avatar_badge_size = kProfileAvatarBadgeSize;
if (app_icon_bitmap.width() != kShortcutIconSize) {
avatar_badge_size =
app_icon_bitmap.width() * kProfileAvatarBadgeSize / kShortcutIconSize;
}
SkBitmap sk_icon = skia::ImageOperations::Resize(
- source_bitmap, skia::ImageOperations::RESIZE_LANCZOS3, avatar_badge_size,
- source_bitmap.height() * avatar_badge_size / source_bitmap.width());
+ avatar_bitmap, skia::ImageOperations::RESIZE_LANCZOS3, avatar_badge_size,
+ avatar_bitmap.height() * avatar_badge_size / avatar_bitmap.width());
// Overlay the avatar on the icon, anchoring it to the bottom-right of the
// icon.

Powered by Google App Engine
This is Rietveld 408576698