Chromium Code Reviews| Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm |
| index 5c8db4db9350042c08121840b5a94532b615ee50..c28a01c51c1380e61046c57b507c639eef313e31 100644 |
| --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm |
| +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm |
| @@ -760,9 +760,13 @@ NSRect GetFirstButtonFrameForHeight(CGFloat height) { |
| } |
| - (void)adjustWindowForButtonCount:(NSUInteger)buttonCount { |
| + if (buttonCount == 0) { |
|
Alexei Svitkine (slow)
2014/08/19 17:01:38
Please add a comment explaining this logic.
Gaja
2014/08/20 05:51:32
Moved this part of code into -removeButton functio
|
| + [self adjustWindowLeft:0 size:NSMakeSize(0, 0) scrollingBy:0.0]; |
|
Alexei Svitkine (slow)
2014/08/19 17:01:38
Why make the window 0 size instead of calling -clo
Gaja
2014/08/20 05:51:32
I do think so. Changes in patch set 2, please revi
|
| + return; |
| + } |
| NSRect folderFrame = [folderView_ frame]; |
| CGFloat newMenuHeight = |
| - (CGFloat)[self menuHeightForButtonCount:[buttons_ count]]; |
| + (CGFloat)[self menuHeightForButtonCount:buttonCount]; |
| CGFloat deltaMenuHeight = newMenuHeight - NSHeight(folderFrame); |
| // If the height has changed then also change the origin, and adjust the |
| // scroll (if scrolling). |
| @@ -1936,9 +1940,10 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) { |
| [folderController_ |
| offsetFolderMenuWindow:NSMakeSize(0.0, chrome::kBookmarkBarHeight)]; |
| } |
| - } else { |
| + } else if (parentButton_ != [barController_ otherBookmarksButton]) { |
| // If all nodes have been removed from this folder then add in the |
| - // 'empty' placeholder button. |
| + // 'empty' placeholder button except for "Other bookmarks" folder |
| + // as we are going to hide it. |
| NSRect buttonFrame = |
| GetFirstButtonFrameForHeight([self menuHeightForButtonCount:1]); |
| BookmarkButton* button = [self makeButtonForNode:nil |