| 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 6163f015f1daf352ec8af7f7bcdc90c51664d6d1..86c4dad4ffe827fc88c0de2bc63dcdcd8d0acdb8 100644
|
| --- a/chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm
|
| +++ b/chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm
|
| @@ -74,6 +74,9 @@ CGFloat ButtonExtraPadding() {
|
| // Extra padding for the MD signed out avatar button.
|
| const CGFloat kMaterialSignedOutWidthPadding = 2;
|
|
|
| +// Kern value for the MD avatar button title.
|
| +const CGFloat kMaterialTitleKern = 0.25;
|
| +
|
| } // namespace
|
|
|
| // Button cell with a custom border given by a set of nine-patch image grids.
|
| @@ -340,13 +343,28 @@ const CGFloat kMaterialSignedOutWidthPadding = 2;
|
| [[NSMutableParagraphStyle alloc] init]);
|
| [paragraphStyle setAlignment:NSLeftTextAlignment];
|
|
|
| - base::scoped_nsobject<NSAttributedString> attributedTitle(
|
| - [[NSAttributedString alloc]
|
| - initWithString:buttonTitle
|
| - attributes:@{ NSShadowAttributeName : shadow.get(),
|
| - NSForegroundColorAttributeName : foregroundColor,
|
| - NSParagraphStyleAttributeName : paragraphStyle }]);
|
| - [button_ setAttributedTitle:attributedTitle];
|
| + if (ui::MaterialDesignController::IsModeMaterial()) {
|
| + base::scoped_nsobject<NSAttributedString> attributedTitle(
|
| + [[NSAttributedString alloc]
|
| + initWithString:buttonTitle
|
| + attributes:@{
|
| + NSForegroundColorAttributeName : foregroundColor,
|
| + NSParagraphStyleAttributeName : paragraphStyle,
|
| + NSKernAttributeName :
|
| + [NSNumber numberWithFloat:kMaterialTitleKern]
|
| + }]);
|
| + [button_ setAttributedTitle:attributedTitle];
|
| + } else {
|
| + base::scoped_nsobject<NSAttributedString> attributedTitle(
|
| + [[NSAttributedString alloc]
|
| + initWithString:buttonTitle
|
| + attributes:@{
|
| + NSShadowAttributeName : shadow.get(),
|
| + NSForegroundColorAttributeName : foregroundColor,
|
| + NSParagraphStyleAttributeName : paragraphStyle
|
| + }]);
|
| + [button_ setAttributedTitle:attributedTitle];
|
| + }
|
| [button_ sizeToFit];
|
|
|
| if (layoutParent) {
|
|
|