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

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: Check before calling setShowsFirstResponder Created 6 years, 6 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..79040eef95a1f9fd2287fe3f81377d71bdc89a3b 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:)]) {
+ // Focused state
+ bool oldFocused = [cell showsFirstResponder];
+ bool focused = states & FocusControlState;
+ if (focused != oldFocused)
+ [cell setShowsFirstResponder:focused];
+ }
// Checked and Indeterminate
bool oldIndeterminate = [cell state] == NSMixedState;

Powered by Google App Engine
This is Rietveld 408576698