Chromium Code Reviews| Index: ui/message_center/cocoa/settings_entry_view.mm |
| diff --git a/ui/message_center/cocoa/settings_entry_view.mm b/ui/message_center/cocoa/settings_entry_view.mm |
| index 0607247f874cfb52844fdbbfd5e3da7b82945306..ae16245d12b6ff60008911c42dc5e87f39531354 100644 |
| --- a/ui/message_center/cocoa/settings_entry_view.mm |
| +++ b/ui/message_center/cocoa/settings_entry_view.mm |
| @@ -55,6 +55,21 @@ const int kCorrectedIconTextPadding = |
| // this metric incorporates the intrinsic learn more blank space to compute it. |
| const int kCorrectedEntryRightPadding = |
| kInternalHorizontalSpacing - kIntrinsicLearnMorePadding; |
| +//////////////////////////////////////////////////////////////////////////////// |
|
Robert Sesek
2014/04/17 13:31:51
nit: blank lines around
dewittj
2014/04/17 16:58:57
Done.
|
| +@interface MCSettingsButton : NSButton |
| +@end |
| + |
| +@implementation MCSettingsButton |
| +// drawRect: needs to fill the button with a background, otherwise we don't get |
| +// subpixel antialiasing. |
| +- (void)drawRect:(NSRect)dirtyRect { |
| + NSColor* color = gfx::SkColorToCalibratedNSColor( |
| + message_center::kMessageCenterBackgroundColor); |
| + [color set]; |
| + NSRectFill(dirtyRect); |
| + [super drawRect:dirtyRect]; |
| +} |
| +@end |
| @interface MCSettingsButtonCell : NSButtonCell { |
| // A checkbox's regular image is the checkmark image. This additional image |
| @@ -65,6 +80,10 @@ const int kCorrectedEntryRightPadding = |
| @end |
| @implementation MCSettingsButtonCell |
| +- (BOOL)isOpaque { |
| + return YES; |
| +} |
| + |
| - (void)setExtraImage:(NSImage*)extraImage { |
| extraImage_.reset([extraImage retain]); |
| } |
| @@ -133,7 +152,6 @@ const int kCorrectedEntryRightPadding = |
| @end |
| @implementation MCSettingsEntryView |
| - |
| - (id)initWithController:(MCSettingsController*)controller |
| notifier:(message_center::Notifier*)notifier |
| frame:(NSRect)frame |
| @@ -218,7 +236,7 @@ const int kCorrectedEntryRightPadding = |
| } |
| if (!checkbox_.get()) { |
| - checkbox_.reset([[NSButton alloc] initWithFrame:checkboxFrame]); |
| + checkbox_.reset([[MCSettingsButton alloc] initWithFrame:checkboxFrame]); |
| [self addSubview:checkbox_]; |
| } else { |
| [checkbox_ setFrame:checkboxFrame]; |