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

Unified Diff: chrome/browser/ui/cocoa/image_button_cell.mm

Issue 140353002: [rAC, OSX] Fix focus ring drawing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
« no previous file with comments | « chrome/browser/ui/cocoa/image_button_cell.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/image_button_cell.mm
diff --git a/chrome/browser/ui/cocoa/image_button_cell.mm b/chrome/browser/ui/cocoa/image_button_cell.mm
index 773c91d6c8963043d1477df5381f4a29f457ec5c..35dede3732e9654fa2fa025c172f988185b43c2c 100644
--- a/chrome/browser/ui/cocoa/image_button_cell.mm
+++ b/chrome/browser/ui/cocoa/image_button_cell.mm
@@ -59,7 +59,7 @@ const CGFloat kImageNoFocusAlpha = 0.65;
return image_[state].image;
}
-- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView {
+- (void)drawImageWithFrame:(NSRect)cellFrame inView:(NSView*)controlView {
image_button_cell::ButtonState state = [self currentButtonState];
BOOL windowHasFocus = [[controlView window] isMainWindow] ||
[[controlView window] isKeyWindow];
@@ -97,8 +97,14 @@ const CGFloat kImageNoFocusAlpha = 0.65;
fraction:alpha
respectFlipped:YES
hints:nil];
+}
- [self drawFocusRingWithFrame:cellFrame inView:controlView];
+- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView {
+ [self drawImageWithFrame:cellFrame inView:controlView];
+ // Only draw custom focus ring if the 10.7 focus ring APIs are not available.
Nico 2014/01/16 00:53:09 Why? Who calls this on 10.7+?
groby-ooo-7-16 2014/01/16 01:05:51 10.7+ automatically draws a focus ring using drawF
+ // TODO(groby): Remove once we build against the 10.7 SDK.
+ if (![self respondsToSelector:@selector(drawFocusRingMaskWithFrame:inView:)])
+ [self drawFocusRingWithFrame:cellFrame inView:controlView];
}
- (void)setImageID:(NSInteger)imageID
« no previous file with comments | « chrome/browser/ui/cocoa/image_button_cell.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698