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

Unified Diff: chrome/browser/ui/cocoa/autofill/autofill_section_container.mm

Issue 144073004: rAc: remove bold section labels on linux_aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ui::ResourceBundle::BoldOnlyIfItLooksGood() Created 6 years, 11 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/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 {

Powered by Google App Engine
This is Rietveld 408576698