| 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..22ff820abc2ebe0ebf2135d3b97126f9d1398344 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,16 @@ 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) {
|
| + itemIcon = profiles::GetAvatarIconForWebUI(itemIcon, true);
|
| + }
|
| + DCHECK(itemIcon.Width() <= profiles::kAvatarIconWidth);
|
| + DCHECK(itemIcon.Height() <= profiles::kAvatarIconHeight);
|
| + [item setImage:itemIcon.ToNSImage()];
|
| [item setState:itemData.active ? NSOnState : NSOffState];
|
| }
|
| [menu insertItem:item atIndex:i + offset];
|
|
|