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

Unified Diff: chrome/browser/ui/cocoa/profile_menu_controller.mm

Issue 149513007: [Mac] The GAIA profile photo should be resized in the Users controller menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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/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..b79b00a65ddf06f09a97c98b31e35c585ee7dd28 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,13 @@ 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.
Alexei Svitkine (slow) 2014/01/29 20:23:56 Nit: Close your parenthesis!
noms (inactive) 2014/01/29 20:31:29 GAH. Done. On 2014/01/29 20:23:56, Alexei Svitkine
+ if (profiles::AvatarIconNeedsResizing(itemIcon))
+ itemIcon = profiles::GetAvatarIconForWebUI(itemIcon, true);
+
+ [item setImage:itemIcon.ToNSImage()];
[item setState:itemData.active ? NSOnState : NSOffState];
}
[menu insertItem:item atIndex:i + offset];
« chrome/browser/profiles/profile_info_util.h ('K') | « chrome/browser/profiles/profile_info_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698