summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-19 21:45:28 +0000
committersail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-19 21:45:28 +0000
commit89ee5f4c071e28622ca21374c0af4ab4be9a1d46 (patch)
treee77401f959716b90ea0343ecc165998c9a161baa /chrome
parentec3c6d115fe0654414fa196b435bc05911167b0d (diff)
downloadchromium_src-89ee5f4c071e28622ca21374c0af4ab4be9a1d46.zip
chromium_src-89ee5f4c071e28622ca21374c0af4ab4be9a1d46.tar.gz
chromium_src-89ee5f4c071e28622ca21374c0af4ab4be9a1d46.tar.bz2
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
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/ui/cocoa/profile_menu_button.mm4
1 files changed, 4 insertions, 0 deletions
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))