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

Unified Diff: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm

Issue 943453003: Add tooltips to profile name when truncated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/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..907da6ef684a9499bff51238e7bd06da5f8bb01c 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];
+
groby-ooo-7-16 2015/02/19 19:00:10 Question: Why not allow expansion tooltips on |pro
+ NSSize textSize = [profileName sizeWithAttributes:
+ @{NSFontAttributeName: [NSFont labelFontOfSize:kTitleFontSize]}];
groby-ooo-7-16 2015/02/19 19:00:10 [profileNameTextField_ font] instead, please.
+
+ if (textSize.width > frameRect.size.width - [hoverImage size].width * 2) {
groby-ooo-7-16 2015/02/19 19:00:10 ... > NSWidth(frameRect) (We're usually avoiding
+ [self setToolTip:profileName];
+ }
}
[[self cell] accessibilitySetOverrideValue:NSAccessibilityButtonRole

Powered by Google App Engine
This is Rietveld 408576698