Chromium Code Reviews| Index: Source/platform/mac/ThemeMac.mm |
| diff --git a/Source/platform/mac/ThemeMac.mm b/Source/platform/mac/ThemeMac.mm |
| index 4e702e1b7071e584c8c439a3175eed4eda8ffcbb..afec7b90af96685802011df8c39237322e041247 100644 |
| --- a/Source/platform/mac/ThemeMac.mm |
| +++ b/Source/platform/mac/ThemeMac.mm |
| @@ -168,13 +168,13 @@ static void updateStates(NSCell* cell, ControlStates states) |
| if (enabled != oldEnabled) |
| [cell setEnabled:enabled]; |
| -#if BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING |
| - // Focused state |
| - bool oldFocused = [cell showsFirstResponder]; |
| - bool focused = states & FocusControlState; |
| - if (focused != oldFocused) |
| - [cell setShowsFirstResponder:focused]; |
| -#endif |
| + if (![cell respondsToSelector:@selector(drawFocusRingMaskWithFrame:inView:)]) { |
|
Robert Sesek
2014/07/21 21:14:38
… and copy that comment here
|
| + // Focused state |
| + bool oldFocused = [cell showsFirstResponder]; |
| + bool focused = states & FocusControlState; |
| + if (focused != oldFocused) |
| + [cell setShowsFirstResponder:focused]; |
| + } |
| // Checked and Indeterminate |
| bool oldIndeterminate = [cell state] == NSMixedState; |
| @@ -297,10 +297,8 @@ static void paintCheckbox(ControlStates states, GraphicsContext* context, const |
| LocalCurrentGraphicsContext localContext(context); |
| NSView *view = ThemeMac::ensuredView(scrollView); |
| [checkboxCell drawWithFrame:NSRect(inflatedRect) inView:view]; |
| -#if !BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING |
| if (states & FocusControlState) |
| [checkboxCell _web_drawFocusRingWithFrame:NSRect(inflatedRect) inView:view]; |
| -#endif |
| [checkboxCell setControlView:nil]; |
| END_BLOCK_OBJC_EXCEPTIONS |
| @@ -378,10 +376,8 @@ static void paintRadio(ControlStates states, GraphicsContext* context, const Int |
| BEGIN_BLOCK_OBJC_EXCEPTIONS |
| NSView *view = ThemeMac::ensuredView(scrollView); |
| [radioCell drawWithFrame:NSRect(inflatedRect) inView:view]; |
| -#if !BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING |
| if (states & FocusControlState) |
| [radioCell _web_drawFocusRingWithFrame:NSRect(inflatedRect) inView:view]; |
| -#endif |
| [radioCell setControlView:nil]; |
| END_BLOCK_OBJC_EXCEPTIONS |
| } |
| @@ -471,10 +467,8 @@ static void paintButton(ControlPart part, ControlStates states, GraphicsContext* |
| NSView *view = ThemeMac::ensuredView(scrollView); |
| [buttonCell drawWithFrame:NSRect(inflatedRect) inView:view]; |
| -#if !BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING |
| if (states & FocusControlState) |
| [buttonCell _web_drawFocusRingWithFrame:NSRect(inflatedRect) inView:view]; |
| -#endif |
| [buttonCell setControlView:nil]; |
| END_BLOCK_OBJC_EXCEPTIONS |