diff options
author | mrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-18 19:40:19 +0000 |
---|---|---|
committer | mrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-18 19:40:19 +0000 |
commit | c7d8072b2d528670f5b4d311009c0984c32545f9 (patch) | |
tree | 530c812aa69965314cc0b280bfce639b211aa2da /chrome/browser/cocoa/bookmark_bar_controller.mm | |
parent | b3415585b7e98945bb5e06d13cb272aaf67b3fde (diff) | |
download | chromium_src-c7d8072b2d528670f5b4d311009c0984c32545f9.zip chromium_src-c7d8072b2d528670f5b4d311009c0984c32545f9.tar.gz chromium_src-c7d8072b2d528670f5b4d311009c0984c32545f9.tar.bz2 |
If the off-the-side menu is showing and one of its bookmarks is removed then also remove the associated button.
BUG=43351
TEST=Add enough bookmarks to the bookmar bar to cause the off-the-side chevron to appear. Pop up the off-the-side folder menu. Delete one of the bookmarks shown therein using the contextual menu. Verify that the bookmark button disappears. Mouse over other bookmarks in the menu and verify no crash occurs.
Review URL: http://codereview.chromium.org/2122010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47546 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bookmark_bar_controller.mm')
-rw-r--r-- | chrome/browser/cocoa/bookmark_bar_controller.mm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_controller.mm b/chrome/browser/cocoa/bookmark_bar_controller.mm index 312e3b8..c6ed5f8 100644 --- a/chrome/browser/cocoa/bookmark_bar_controller.mm +++ b/chrome/browser/cocoa/bookmark_bar_controller.mm @@ -2219,6 +2219,7 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) { - (void)removeButton:(NSInteger)buttonIndex animate:(BOOL)animate { if (buttonIndex < (NSInteger)[buttons_ count]) { + // The button being removed is showing in the bar. BookmarkButton* oldButton = [buttons_ objectAtIndex:buttonIndex]; NSRect poofFrame = [oldButton bounds]; NSPoint poofPoint = NSMakePoint(NSMidX(poofFrame), NSMidY(poofFrame)); @@ -2243,6 +2244,11 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) { } --displayedButtonCount_; [self reconfigureBookmarkBar]; + } else if (folderController_) { + // The button being removed is in the OTS (off-the-side) and the OTS + // menu is showing so we need to remove the button. + NSInteger index = buttonIndex - displayedButtonCount_; + [folderController_ removeButton:index animate:YES]; } } |