[go: up one dir, main page]

Mac: Fix tab title vertical alignment on OS X 10.11 (Merge to M45)

System fonts have special attributes starting with 10.11, they should not be
requested by name.

BUG=503786
TBR=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1224253003

Cr-Commit-Position: refs/heads/master@{#338755}
(cherry picked from commit 5fb943471a154e125c325dc3f9d404d085507c41)

Review URL: https://codereview.chromium.org/1339553003 .

Cr-Commit-Position: refs/branch-heads/2454@{#478}
Cr-Branched-From: 12bfc3360892ec53cd00fc239a47e5298beb063b-refs/heads/master@{#338390}
diff --git a/chrome/browser/ui/cocoa/tabs/tab_view.mm b/chrome/browser/ui/cocoa/tabs/tab_view.mm
index a93d24a..0a4819e 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_view.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_view.mm
@@ -97,9 +97,7 @@
         [[GTMFadeTruncatingTextFieldCell alloc] initTextCell:@"Label"]);
     [labelCell setControlSize:NSSmallControlSize];
     CGFloat fontSize = [NSFont systemFontSizeForControlSize:NSSmallControlSize];
-    NSFont* font = [NSFont fontWithName:[[labelCell font] fontName]
-                                   size:fontSize];
-    [labelCell setFont:font];
+    [labelCell setFont:[NSFont systemFontOfSize:fontSize]];
     [titleView_ setCell:labelCell];
     titleViewCell_ = labelCell;