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

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: Created 5 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 20a4ff0e6b88c473bcf726779352a86c39120285..d4feb65d26d8b17fe5963739842e0933f9f57b52 100644
--- a/Source/platform/mac/ThemeMac.mm
+++ b/Source/platform/mac/ThemeMac.mm
@@ -141,13 +141,11 @@ 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
// Checked and Indeterminate
bool oldIndeterminate = [cell state] == NSMixedState;
@@ -214,7 +212,6 @@ IntRect ThemeMac::inflateRectForAA(const IntRect& rect) {
// static
IntRect ThemeMac::inflateRectForFocusRing(const IntRect& rect) {
-#if BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING
// Just put a margin of 16 units around the rect. The UI elements that use this don't appropriately
// scale their focus rings appropriately (e.g, paint pickers), or switch to non-native widgets when
// scaled (e.g, check boxes and radio buttons).
@@ -225,9 +222,6 @@ IntRect ThemeMac::inflateRectForFocusRing(const IntRect& rect) {
result.setWidth(rect.width() + 2 * margin);
result.setHeight(rect.height() + 2 * margin);
return result;
-#else
- return rect;
-#endif
}
// Checkboxes
@@ -305,10 +299,8 @@ static void paintCheckbox(ControlStates states, GraphicsContext* context, const
LocalCurrentGraphicsContext localContext(context, ThemeMac::inflateRectForFocusRing(inflatedRect));
NSView* view = ensuredView(scrollableArea);
[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
@@ -388,10 +380,8 @@ static void paintRadio(ControlStates states, GraphicsContext* context, const Int
BEGIN_BLOCK_OBJC_EXCEPTIONS
NSView* view = ensuredView(scrollableArea);
[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
}
@@ -481,10 +471,8 @@ static void paintButton(ControlPart part, ControlStates states, GraphicsContext*
NSView* view = ensuredView(scrollableArea);
[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