Chromium Code Reviews| Index: chrome/browser/ui/cocoa/profile_menu_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/profile_menu_controller.mm b/chrome/browser/ui/cocoa/profile_menu_controller.mm |
| index 50a40db8f6f2816d2dcfb692572741579dd26f79..c30e163764203205cce121160b61641d4a6a6d91 100644 |
| --- a/chrome/browser/ui/cocoa/profile_menu_controller.mm |
| +++ b/chrome/browser/ui/cocoa/profile_menu_controller.mm |
| @@ -12,6 +12,7 @@ |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/profiles/profile_info_cache.h" |
| #include "chrome/browser/profiles/profile_info_interface.h" |
| +#include "chrome/browser/profiles/profile_info_util.h" |
| #include "chrome/browser/profiles/profile_manager.h" |
| #include "chrome/browser/profiles/profile_metrics.h" |
| #include "chrome/browser/ui/browser.h" |
| @@ -129,7 +130,14 @@ class Observer : public chrome::BrowserListObserver, |
| if (dock) { |
| [item setIndentationLevel:1]; |
| } else { |
| - [item setImage:itemData.icon.ToNSImage()]; |
| + gfx::Image itemIcon = itemData.icon; |
| + // The image might be too large and need to be resized (i.e. if this is |
| + // a signed-in user using the GAIA profile photo). |
| + if (itemIcon.Width() > profiles::kAvatarIconWidth || |
| + itemIcon.Height() > profiles::kAvatarIconHeight) |
|
Alexei Svitkine (slow)
2014/01/29 21:08:25
Nit: add {}
noms (inactive)
2014/01/29 22:14:19
Done.
|
| + itemIcon = profiles::GetAvatarIconForWebUI(itemIcon, true); |
|
Alexei Svitkine (slow)
2014/01/29 21:08:25
Maybe add DCHECKs that the new size meets the crit
noms (inactive)
2014/01/29 22:14:19
Done.
|
| + |
| + [item setImage:itemIcon.ToNSImage()]; |
| [item setState:itemData.active ? NSOnState : NSOffState]; |
| } |
| [menu insertItem:item atIndex:i + offset]; |