Chromium Code Reviews| Index: chrome/browser/ui/cocoa/autofill/autofill_section_container.mm |
| diff --git a/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm b/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm |
| index 0372a7dd5b91f18d80acf91819c5bd6ef3a8c45e..a6a2eadf28de0aacc9b434f786a42fdf78ef5ae4 100644 |
| --- a/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm |
| +++ b/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm |
| @@ -99,7 +99,7 @@ bool ShouldOverwriteComboboxes(autofill::DialogSection section, |
| - (BOOL)isCreditCardSection; |
| // Create properly styled label for section. Autoreleased. |
| -- (NSTextField*)makeDetailSectionLabel:(NSString*)labelText; |
| +- (NSTextField*)makeDetailSectionLabel:(const autofill::SectionLabel&)label; |
| // Create a button offering input suggestions. |
| - (MenuButton*)makeSuggestionButton; |
| @@ -161,10 +161,8 @@ bool ShouldOverwriteComboboxes(autofill::DialogSection section, |
| - (void)loadView { |
| [self makeInputControls]; |
| - base::string16 labelText = delegate_->LabelForSection(section_); |
| - label_.reset( |
| - [[self makeDetailSectionLabel:base::SysUTF16ToNSString(labelText)] |
| - retain]); |
| + const autofill::SectionLabel label = delegate_->LabelForSection(section_); |
| + label_.reset([[self makeDetailSectionLabel:label] retain]); |
| suggestButton_.reset([[self makeSuggestionButton] retain]); |
| suggestContainer_.reset([[AutofillSuggestionContainer alloc] init]); |
| @@ -478,17 +476,19 @@ bool ShouldOverwriteComboboxes(autofill::DialogSection section, |
| } |
| } |
| -- (NSTextField*)makeDetailSectionLabel:(NSString*)labelText { |
| - base::scoped_nsobject<NSTextField> label([[NSTextField alloc] init]); |
| - [label setFont: |
| - [[NSFontManager sharedFontManager] convertFont:[label font] |
| - toHaveTrait:NSBoldFontMask]]; |
| - [label setStringValue:labelText]; |
| - [label setEditable:NO]; |
| - [label setBordered:NO]; |
| - [label setDrawsBackground:NO]; |
| - [label sizeToFit]; |
| - return label.autorelease(); |
| +- (NSTextField*)makeDetailSectionLabel:(const autofill::SectionLabel&)label { |
| + base::scoped_nsobject<NSTextField> textfield([[NSTextField alloc] init]); |
| + if (label.font & ui::ResourceBundle::BoldFont) { |
|
Nico
2014/01/23 03:13:56
bitmasks in an api are bad api
|
| + [textfield setFont: |
| + [[NSFontManager sharedFontManager] convertFont:[textfield font] |
| + toHaveTrait:NSBoldFontMask]]; |
| + } |
| + [textfield setStringValue:base::SysUTF16ToNSString(label.text)]; |
| + [textfield setEditable:NO]; |
| + [textfield setBordered:NO]; |
| + [textfield setDrawsBackground:NO]; |
| + [textfield sizeToFit]; |
| + return textfield.autorelease(); |
| } |
| - (void)updateAndClobber:(BOOL)shouldClobber { |