diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-05 23:38:34 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-05 23:38:34 +0000 |
commit | 3bb0b82f159c8784cd71a371d106eaefd97114e9 (patch) | |
tree | 0adab0ba4b78f9caa42be944849a4ee0825dfbc7 /chrome/browser/cocoa/menu_button.mm | |
parent | 9dc32ca678b8295b5a68cd1ddf90467c8a4502cf (diff) | |
download | chromium_src-3bb0b82f159c8784cd71a371d106eaefd97114e9.zip chromium_src-3bb0b82f159c8784cd71a371d106eaefd97114e9.tar.gz chromium_src-3bb0b82f159c8784cd71a371d106eaefd97114e9.tar.bz2 |
Mac: Eliminate unintended "menu" method overrides.
This had the bad effect of showing bad/strange menus upon right-click on various buttons or, worse, crashing.
BUG=22148,23606
TEST=Right click on back/forwards buttons (after some navigation so that they're active), page/wrench buttons, and bookmark bar off-the-side button and make sure no menu is shown (and it that it doesn't crash). Also do so when the menu is active/highlighted with menu already showing.
Review URL: http://codereview.chromium.org/251091
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28064 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/menu_button.mm')
-rw-r--r-- | chrome/browser/cocoa/menu_button.mm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/browser/cocoa/menu_button.mm b/chrome/browser/cocoa/menu_button.mm index 23d5d0e..bfa31ea 100644 --- a/chrome/browser/cocoa/menu_button.mm +++ b/chrome/browser/cocoa/menu_button.mm @@ -45,7 +45,7 @@ // Accessors and mutators: -@synthesize menu = menu_; +@synthesize attachedMenu = attachedMenu_; @end // @implementation MenuButton @@ -67,7 +67,7 @@ // Actually show the menu (in the correct location). |isDragging| indicates // whether the mouse button is still down or not. - (void)showMenu:(BOOL)isDragging { - if (!menu_) { + if (![self attachedMenu]) { LOG(WARNING) << "No menu available."; if (isDragging) { // If we're dragging, wait for mouse up. @@ -96,7 +96,7 @@ [[NSPopUpButtonCell alloc] initTextCell:@"" pullsDown:YES]); DCHECK(popUpCell.get()); - [popUpCell setMenu:menu_]; + [popUpCell setMenu:[self attachedMenu]]; [popUpCell selectItem:nil]; [popUpCell attachPopUpWithFrame:frame inView:self]; |