Chromium Code Reviews| 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 2c8a22324cf495473a723774790156fe4271c5b1..415e592401dc36cf29002c7fb0fd95c2c29e72a8 100644 |
| --- a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm |
| +++ b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm |
| @@ -701,6 +701,13 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
| IDS_PROFILES_NEW_AVATAR_MENU_EDIT_NAME_ACCESSIBLE_NAME, |
| base::SysNSStringToUTF16(profileName)) |
| forAttribute:NSAccessibilityTitleAttribute]; |
| + |
| + NSSize textSize = [profileName sizeWithAttributes: |
| + @{NSFontAttributeName: [profileNameTextField_ font]}]; |
| + |
| + if (textSize.width > frameRect.size.width - [hoverImage size].width * 2) { |
| + [self setToolTip:profileName]; |
| + } |
| } |
| [[self cell] accessibilitySetOverrideValue:NSAccessibilityButtonRole |
| @@ -1805,6 +1812,15 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
| [profileButton setTarget:self]; |
| [profileButton setAction:@selector(switchToProfile:)]; |
| + NSSize textSize = [[profileButton title] sizeWithAttributes: |
| + @{NSFontAttributeName: [profileButton font]}]; |
| + |
| + if (lroundf(textSize.width) > |
|
groby-ooo-7-16
2015/02/20 17:01:07
Why round here?
|
| + rect.size.width - kSmallImageSide - |
| + kImageTitleSpacing - kHorizontalSpacing) { |
| + [profileButton setToolTip:[profileButton title]]; |
| + } |
| + |
| return profileButton.autorelease(); |
| } |