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

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_view.mm

Issue 11823047: mac: Pixel-based click detection for the tab close button (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sail Created 7 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/hover_close_button.mm ('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/tabs/tab_view.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_view.mm b/chrome/browser/ui/cocoa/tabs/tab_view.mm
index 3657ca602293a0269140473c09d903884e32137d..5677d640d7b2c9bb173f81ed66136645f5986a57 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_view.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_view.mm
@@ -147,8 +147,12 @@ const CGFloat kRapidCloseDist = 2.5;
// view or our child close button.
- (NSView*)hitTest:(NSPoint)aPoint {
NSPoint viewPoint = [self convertPoint:aPoint fromView:[self superview]];
- if (![closeButton_ isHidden])
- if (NSPointInRect(viewPoint, [closeButton_ frame])) return closeButton_;
+ if (![closeButton_ isHidden]) {
+ if (NSPointInRect(viewPoint,[closeButton_ frame]) &&
+ [closeButton_ hitTest:viewPoint]) {
+ return closeButton_;
+ }
+ }
NSRect pointRect = NSMakeRect(viewPoint.x, viewPoint.y, 1, 1);
« no previous file with comments | « chrome/browser/ui/cocoa/hover_close_button.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698