From 89ee5f4c071e28622ca21374c0af4ab4be9a1d46 Mon Sep 17 00:00:00 2001 From: "sail@chromium.org" Date: Tue, 19 Apr 2011 21:45:28 +0000 Subject: Mac: Fix exception thrown by profile menu button Clicking on the hidden profile menu button would cause a Objective-C exception to be thrown. The problem was that I was implementing my own hit testing and I didn't check to see if the view was hidden. BUG=79890 TEST=Clicked in the top right of the browser window. Verified that without my change this caused an exception to be thrown. With my change no exception was thrown. Review URL: http://codereview.chromium.org/6882048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82167 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/ui/cocoa/profile_menu_button.mm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'chrome') diff --git a/chrome/browser/ui/cocoa/profile_menu_button.mm b/chrome/browser/ui/cocoa/profile_menu_button.mm index db2f8ee..866bb40 100644 --- a/chrome/browser/ui/cocoa/profile_menu_button.mm +++ b/chrome/browser/ui/cocoa/profile_menu_button.mm @@ -150,6 +150,10 @@ NSColor* GetBlackWithAlpha(CGFloat alpha) { } - (NSView*)hitTest:(NSPoint)aPoint { + NSView* probe = [super hitTest:aPoint]; + if (probe != self) + return probe; + NSPoint viewPoint = [self convertPoint:aPoint fromView:[self superview]]; BOOL isFlipped = [self isFlipped]; if (NSMouseInRect(viewPoint, [self tabRect], isFlipped)) -- cgit v1.1