Index: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm |
diff --git a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm |
index ddb04bcd659ee7942beaec1cb0ce8eb552063c37..a79c2a2348e0ec4e2aadeb56bff9d84f2e390c9d 100644 |
--- a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm |
+++ b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm |
@@ -411,18 +411,23 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
// Hide the button until the image is hovered over. |
[changePhotoButton_ setHidden:YES]; |
} |
- |
- // Add the frame overlay last, so that both the photo and the button |
- // look like circles. |
- base::scoped_nsobject<NSImageView> frameOverlay( |
- [[NSImageView alloc] initWithFrame:bounds]); |
- [frameOverlay setImage:ui::ResourceBundle::GetSharedInstance(). |
- GetNativeImageNamed(IDR_ICON_PROFILES_AVATAR_PHOTO_FRAME).AsNSImage()]; |
- [self addSubview:frameOverlay]; |
} |
return self; |
} |
+- (void)drawRect:(NSRect)dirtyRect { |
+ NSRect bounds = [self bounds]; |
+ |
+ // Display the profile picture as a circle. |
+ NSBezierPath* path = [NSBezierPath bezierPathWithOvalInRect:bounds]; |
+ [path addClip]; |
+ [self.image drawAtPoint:bounds.origin |
+ fromRect:bounds |
+ operation:NSCompositeSourceOver |
+ fraction:1.0]; |
+ |
+} |
+ |
- (void)editPhoto:(id)sender { |
avatarMenu_->EditProfile(avatarMenu_->GetActiveProfileIndex()); |
} |