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

Side by Side Diff: chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm

Issue 1819753003: Allow various font weights in gfx. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac fixes Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h" 5 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 return skia::SkColorToCalibratedNSColor(SkColorSetRGB(0xc5, 0x39, 0x29)); 71 return skia::SkColorToCalibratedNSColor(SkColorSetRGB(0xc5, 0x39, 0x29));
72 } 72 }
73 NSColor* URLTextColor() { 73 NSColor* URLTextColor() {
74 return [NSColor colorWithCalibratedRed:0.0 green:0.55 blue:0.0 alpha:1.0]; 74 return [NSColor colorWithCalibratedRed:0.0 green:0.55 blue:0.0 alpha:1.0];
75 } 75 }
76 76
77 NSFont* FieldFont() { 77 NSFont* FieldFont() {
78 return OmniboxViewMac::GetFieldFont(gfx::Font::NORMAL); 78 return OmniboxViewMac::GetFieldFont(gfx::Font::NORMAL);
79 } 79 }
80 NSFont* BoldFieldFont() { 80 NSFont* BoldFieldFont() {
81 return OmniboxViewMac::GetFieldFont(gfx::Font::BOLD); 81 // TODO(mboc): Get the bold font.
msw 2016/03/25 22:02:14 You'll need to fix this before landing, afaict.
tapted 2016/03/27 23:10:02 Yes - please do this. See my suggestion below.
Mikus 2016/03/29 10:55:38 Done.
82 return OmniboxViewMac::GetFieldFont(gfx::Font::NORMAL);
82 } 83 }
83 NSFont* LargeFont() { 84 NSFont* LargeFont() {
84 return OmniboxViewMac::GetLargeFont(gfx::Font::NORMAL); 85 return OmniboxViewMac::GetLargeFont(gfx::Font::NORMAL);
85 } 86 }
86 NSFont* LargeSuperscriptFont() { 87 NSFont* LargeSuperscriptFont() {
87 NSFont* font = OmniboxViewMac::GetLargeFont(gfx::Font::NORMAL); 88 NSFont* font = OmniboxViewMac::GetLargeFont(gfx::Font::NORMAL);
88 // Calculate a slightly smaller font. The ratio here is somewhat arbitrary. 89 // Calculate a slightly smaller font. The ratio here is somewhat arbitrary.
89 // Proportions from 5/9 to 5/7 all look pretty good. 90 // Proportions from 5/9 to 5/7 all look pretty good.
90 CGFloat size = [font pointSize] * 5.0 / 9.0; 91 CGFloat size = [font pointSize] * 5.0 / 9.0;
91 NSFontDescriptor* descriptor = [font fontDescriptor]; 92 NSFontDescriptor* descriptor = [font fontDescriptor];
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 return base::i18n::IsRTL() ? (inputWidth - glyphOffset) : glyphOffset; 628 return base::i18n::IsRTL() ? (inputWidth - glyphOffset) : glyphOffset;
628 } 629 }
629 630
630 + (NSAttributedString*)createSeparatorString { 631 + (NSAttributedString*)createSeparatorString {
631 base::string16 raw_separator = 632 base::string16 raw_separator =
632 l10n_util::GetStringUTF16(IDS_AUTOCOMPLETE_MATCH_DESCRIPTION_SEPARATOR); 633 l10n_util::GetStringUTF16(IDS_AUTOCOMPLETE_MATCH_DESCRIPTION_SEPARATOR);
633 return CreateAttributedString(raw_separator, DimTextColor()); 634 return CreateAttributedString(raw_separator, DimTextColor());
634 } 635 }
635 636
636 @end 637 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698