Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1166)

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm

Issue 485003002: Adding (empty) placeholder button to 'Other bookmarks' folder is unnecessary. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698