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

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

Issue 606593002: Move bookmark's folder menu upwards only when its parent button is moved (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments and refactor code covering one more test case. Created 6 years, 3 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 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
« 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