Index: chrome/browser/ui/cocoa/gradient_button_cell.mm |
=================================================================== |
--- chrome/browser/ui/cocoa/gradient_button_cell.mm (revision 84009) |
+++ chrome/browser/ui/cocoa/gradient_button_cell.mm (working copy) |
@@ -725,7 +725,7 @@ |
[self updateTrackingAreas]; |
} |
-- (void)updateTrackingAreas { |
+- (BOOL)isMouseReallyInside { |
BOOL mouseInView = NO; |
NSView* controlView = [self controlView]; |
NSWindow* window = [controlView window]; |
@@ -735,7 +735,13 @@ |
mousePoint = [controlView convertPointFromBase:mousePoint]; |
mouseInView = [controlView mouse:mousePoint inRect:bounds]; |
} |
+ return mouseInView; |
+} |
+- (void)updateTrackingAreas { |
+ NSView* controlView = [self controlView]; |
+ BOOL mouseInView = [self isMouseReallyInside]; |
+ |
if (trackingArea_.get()) |
[controlView removeTrackingArea:trackingArea_]; |
@@ -745,12 +751,12 @@ |
options |= NSTrackingAssumeInside; |
trackingArea_.reset([[NSTrackingArea alloc] |
- initWithRect:bounds |
+ initWithRect:[controlView bounds] |
options:options |
owner:self |
userInfo:nil]); |
if (isMouseInside_ != mouseInView) { |
- isMouseInside_ = mouseInView; |
+ [self setMouseInside:mouseInView animate:NO]; |
[controlView setNeedsDisplay:YES]; |
} |
} |