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

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

Issue 312233003: Add fade eliding for Views Labels; related cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refine alignment check; minor additional cleanup. Created 6 years, 6 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/avatar_button_controller.mm
diff --git a/chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm b/chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm
index efec9e26d994f4de61c49ccfdcf0a7787c549291..dbacedb55c10b49c0194a04406f9fd55bcd548d0 100644
--- a/chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm
+++ b/chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm
@@ -179,13 +179,10 @@ NSImage* GetImageFromResourceID(int resourceId) {
}
- (base::string16)getElidedAvatarName {
- base::string16 avatarName =
- profiles::GetAvatarNameForProfile(browser_->profile());
+ base::string16 name = profiles::GetAvatarNameForProfile(browser_->profile());
int maxTextWidth = kMaxButtonContentWidth - [[button_ image] size].width;
- return gfx::ElideText(avatarName,
- gfx::FontList(gfx::Font([button_ font])),
- maxTextWidth,
- gfx::ELIDE_AT_END);
+ return gfx::ElideText(name, gfx::FontList(gfx::Font([button_ font])),
+ maxTextWidth, gfx::ELIDE_TAIL);
}
- (void)updateAvatarButtonAndLayoutParent:(BOOL)layoutParent {

Powered by Google App Engine
This is Rietveld 408576698