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

Unified Diff: chrome/browser/ui/views/profiles/avatar_menu_bubble_view.cc

Issue 257843004: Add in resize logic for the non-badged icons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« 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/profiles/avatar_menu_bubble_view.cc
diff --git a/chrome/browser/ui/views/profiles/avatar_menu_bubble_view.cc b/chrome/browser/ui/views/profiles/avatar_menu_bubble_view.cc
index aa3b695147aa85ca215b3e0b86f10069d11cea3d..5f48429eb21a124ffa0c84327ab5a4aa0811080a 100644
--- a/chrome/browser/ui/views/profiles/avatar_menu_bubble_view.cc
+++ b/chrome/browser/ui/views/profiles/avatar_menu_bubble_view.cc
@@ -260,10 +260,14 @@ ProfileItemView::ProfileItemView(const AvatarMenu::Item& item,
image_view_ = new ProfileImageView();
gfx::ImageSkia profile_icon = *item_.icon.ToImageSkia();
- if (item_.active || item_.signin_required)
+ if (item_.active || item_.signin_required) {
image_view_->SetImage(GetBadgedIcon(profile_icon));
- else
- image_view_->SetImage(profile_icon);
+ } else {
+ // GetSizedAvatarIcon will resize the icon in case it's too large
+ image_view_->SetImage(profiles::GetSizedAvatarIcon(
msw 2014/04/25 19:50:45 The ImageView class comment says "If a size is pro
Mike Lerman 2014/04/28 13:21:26 Done.
+ item_.icon, false, profiles::kAvatarIconWidth, kItemHeight).
+ ToImageSkia());
msw 2014/04/29 19:25:46 nit: I think this ought to be indented four more s
Mike Lerman 2014/04/29 20:56:57 Done.
+ }
AddChildView(image_view_);
// Add a label to show the profile name.
« 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