Chromium Code Reviews| Index: chrome/browser/ui/cocoa/browser/avatar_button_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm b/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm |
| index 3537ad9af71fec8e16c557ccf39d1546369a06f9..66ba5d259239d647640ea18086ee666c3b1c03d7 100644 |
| --- a/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm |
| +++ b/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm |
| @@ -8,6 +8,7 @@ |
| #include "chrome/browser/browser_process.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/profiles/profile_info_cache.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" |
| @@ -122,7 +123,8 @@ const CGFloat kMenuYOffsetAdjust = 1.0; |
| [self setView:button]; |
| if (browser_->profile()->IsOffTheRecord()) { |
| - [self setImage:gfx::GetCachedImageWithName(@"otr_icon.pdf")]; |
| + [self setImage:[self compositeImageWithShadow: |
| + gfx::GetCachedImageWithName(@"otr_icon.pdf")]]; |
| [self setOpenMenuOnClick:NO]; |
| } else { |
| observer_.reset(new AvatarButtonControllerInternal::Observer(self)); |
| @@ -146,7 +148,7 @@ const CGFloat kMenuYOffsetAdjust = 1.0; |
| } |
| - (void)setImage:(NSImage*)image { |
| - [self.buttonView setImage:[self compositeImageWithShadow:image]]; |
| + [self.buttonView setImage:image]; |
|
sail
2011/11/26 06:52:00
I moved this so that it only applies to the incogn
|
| } |
| - (void)showAvatarBubble { |
| @@ -237,7 +239,13 @@ const CGFloat kMenuYOffsetAdjust = 1.0; |
| size_t index = |
| cache.GetIndexOfProfileWithPath(browser_->profile()->GetPath()); |
| if (index != std::string::npos) { |
| - [self setImage:cache.GetAvatarIconOfProfileAtIndex(index).ToNSImage()]; |
| + bool is_gaia_picture = |
|
Robert Sesek
2011/11/28 19:17:53
BOOL
sail
2011/11/28 19:40:31
Done.
|
| + cache.IsUsingGAIAPictureOfProfileAtIndex(index) && |
| + !cache.GetGAIAPictureOfProfileAtIndex(index).IsNull(); |
| + gfx::Image icon = profiles::GetAvatarIconForTitleBar( |
| + cache.GetAvatarIconOfProfileAtIndex(index), is_gaia_picture, |
| + profiles::kAvatarIconWidth, profiles::kAvatarIconHeight); |
| + [self setImage:icon.ToNSImage()]; |
| const string16& name = cache.GetNameOfProfileAtIndex(index); |
| NSString* nsName = base::SysUTF16ToNSString(name); |