| Index: chrome/browser/ui/cocoa/hover_close_button.mm
|
| diff --git a/chrome/browser/ui/cocoa/hover_close_button.mm b/chrome/browser/ui/cocoa/hover_close_button.mm
|
| index 28322b4eae5c3d77c07bd4afa9e906a6a59b680d..f6065af48023ac6833ea8a057052b598fc638358 100644
|
| --- a/chrome/browser/ui/cocoa/hover_close_button.mm
|
| +++ b/chrome/browser/ui/cocoa/hover_close_button.mm
|
| @@ -79,6 +79,22 @@ NSString* const kFadeOutValueKeyPath = @"fadeOutValue";
|
| [self animationDidStop:animation];
|
| }
|
|
|
| +// Override to only accept clicks within the bounds of the defined path, not
|
| +// the entire bounding box. |aPoint| is in the superview's coordinate system.
|
| +- (NSView*)hitTest:(NSPoint)point {
|
| + NSPoint localPoint = [self convertPoint:point fromView:[self superview]];
|
| + NSRect pointRect = NSMakeRect(localPoint.x, localPoint.y, 1, 1);
|
| +
|
| + NSImage* hoverImage = [self imageForHoverState:kHoverStateMouseOver];
|
| + if ([hoverImage hitTestRect:pointRect
|
| + withImageDestinationRect:[self bounds]
|
| + context:nil
|
| + hints:nil
|
| + flipped:YES])
|
| + return [super hitTest:point];
|
| + return nil;
|
| +}
|
| +
|
| - (void)drawRect:(NSRect)dirtyRect {
|
| NSImage* image = [self imageForHoverState:[self hoverState]];
|
|
|
|
|