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

Side by Side Diff: Source/platform/mac/WebCoreNSCellExtras.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, 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/platform/mac/ThemeMac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 12 matching lines...) Expand all
23 * THE POSSIBILITY OF SUCH DAMAGE. 23 * THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #import "platform/mac/WebCoreNSCellExtras.h" 26 #import "platform/mac/WebCoreNSCellExtras.h"
27 27
28 #if !BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING 28 #if !BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING
29 29
30 @implementation NSCell (WebCoreFocusRingDrawing) 30 @implementation NSCell (WebCoreFocusRingDrawing)
31 31
32 - (void)_web_drawFocusRingWithFrame:(NSRect)cellFrame inView:(NSView *)controlVi ew 32 - (void)_web_drawFocusRingWithFrame:(NSRect)cellFrame inView:(NSView *)controlVi ew
33 { 33 {return;
Robert Sesek 2014/07/17 15:12:32 Spurious return.
keishi 2014/07/18 13:26:55 Done.
34 // FIXME: Remove this check when we drop support for Mac OS X 10.6
35 if (![self respondsToSelector:@selector(drawFocusRingMaskWithFrame:inView:)] )
36 return;
34 CGContextRef cgContext = (CGContextRef)[[NSGraphicsContext currentContext] g raphicsPort]; 37 CGContextRef cgContext = (CGContextRef)[[NSGraphicsContext currentContext] g raphicsPort];
35 CGContextSaveGState(cgContext); 38 CGContextSaveGState(cgContext);
36 NSSetFocusRingStyle(NSFocusRingOnly); 39 NSSetFocusRingStyle(NSFocusRingOnly);
37 CGContextBeginTransparencyLayerWithRect(cgContext, NSRectToCGRect(cellFrame) , 0); 40 CGContextBeginTransparencyLayerWithRect(cgContext, NSRectToCGRect(cellFrame) , 0);
38 [self drawFocusRingMaskWithFrame:cellFrame inView:controlView]; 41 [self drawFocusRingMaskWithFrame:cellFrame inView:controlView];
39 CGContextEndTransparencyLayer(cgContext); 42 CGContextEndTransparencyLayer(cgContext);
40 CGContextRestoreGState(cgContext); 43 CGContextRestoreGState(cgContext);
41 } 44 }
42 45
43 @end 46 @end
44 47
45 #endif // !BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING 48 #endif // !BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING
OLDNEW
« no previous file with comments | « Source/platform/mac/ThemeMac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698