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

Unified Diff: Source/platform/mac/ThemeMac.mm

Issue 368003002: Check if drawFocusRingMaskWithFrame:inView: exists when drawing focus ring (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Removed BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING Created 6 years, 5 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: 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

Powered by Google App Engine
This is Rietveld 408576698