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 2eb0880c5f79ed46df5d53ad068412a2a6691471..94873d3f74e3f3f99962b83bdc86b6226125d0b1 100644 |
| --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm |
| +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm |
| @@ -1934,12 +1934,16 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) { |
| // Search for and adjust submenus, if necessary. |
| NSInteger buttonCount = [buttons_ count]; |
| if (buttonCount) { |
| - BookmarkButton* subButton = [folderController_ parentButton]; |
| - for (NSButton* aButton in buttons_.get()) { |
| - // If this button is showing its menu then we need to move the menu, too. |
| - if (aButton == subButton) |
| - [folderController_ |
| - offsetFolderMenuWindow:NSMakeSize(0.0, chrome::kBookmarkBarHeight)]; |
| + // In case of Drag & Drop within a folder, if the target folder is showing |
|
Alexei Svitkine (slow)
2014/10/02 20:55:59
I'm not sure this behavior (as described by the co
Gaja
2014/10/05 05:41:27
Done.
|
| + // its menu during drop and is below the dragged item, the folder moves |
| + // upwards by kBookmarkFolderButtonHeight, then we need to move the menu, |
| + // too. |
| + if (folderController_) { |
| + BookmarkButton* targetButton = [folderController_ parentButton]; |
| + NSInteger dropIndex = [buttons_ indexOfObject:targetButton]; |
| + if ((dropIndex + 1) > buttonIndex) |
|
Alexei Svitkine (slow)
2014/10/02 20:55:59
Nit: {}'s
Gaja
2014/10/05 05:41:27
Done.
|
| + [folderController_ offsetFolderMenuWindow:NSMakeSize( |
| + 0.0, bookmarks::kBookmarkFolderButtonHeight)]; |
| } |
| } else if (parentButton_ != [barController_ otherBookmarksButton]) { |
| // If all nodes have been removed from this folder then add in the |