diff options
author | mrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-04 23:21:46 +0000 |
---|---|---|
committer | mrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-04 23:21:46 +0000 |
commit | e460f3436a92c27af1f45449993c8c5a31b0b2ff (patch) | |
tree | d2d528aec1205f8352ad3f959503c97addde17e7 /chrome/browser/cocoa/bookmark_folder_target.mm | |
parent | 8bc1b7592e5a2481d284fac6d88720cd88380ae9 (diff) | |
download | chromium_src-e460f3436a92c27af1f45449993c8c5a31b0b2ff.zip chromium_src-e460f3436a92c27af1f45449993c8c5a31b0b2ff.tar.gz chromium_src-e460f3436a92c27af1f45449993c8c5a31b0b2ff.tar.bz2 |
Should not just always close a folder menu unless there is a true need to change menus.
BUG=42982
TEST=1) Drag a couple of populated folders into the "Other Bookmarks" folder. Open one of those folders. Drag a bookmark from that folder out to be on top of the contain folder's button but don't release. Verify that the subfolder from which the bookmark came does not automatically close. Continue dragging so that the bookmark is now over the other folder. Verify that the old subfolder closes and the new folder opens. Drop the bookmark and verify that the bookmark is now in the second folder.
2) Locate a bookmark in a subfolder in a regular bar folder. Hover over it and verify that it opens automatically. Click once and verify that the folder closes. Click again and verify that it opens again.
Review URL: http://codereview.chromium.org/1935001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46402 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bookmark_folder_target.mm')
-rw-r--r-- | chrome/browser/cocoa/bookmark_folder_target.mm | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/chrome/browser/cocoa/bookmark_folder_target.mm b/chrome/browser/cocoa/bookmark_folder_target.mm index 57cb7f9..b47e5a77 100644 --- a/chrome/browser/cocoa/bookmark_folder_target.mm +++ b/chrome/browser/cocoa/bookmark_folder_target.mm @@ -37,15 +37,6 @@ NSString* kBookmarkButtonDragType = @"ChromiumBookmarkButtonDragType"; // a click-to-open. Thus the path to get here is a little twisted. - (IBAction)openBookmarkFolderFromButton:(id)sender { DCHECK(sender); - BOOL same = false; - - if ([controller_ folderController]) { - // closeAllBookmarkFolders sets folderController_ to nil - // so we need the SAME check to happen first. - same = ([[controller_ folderController] parentButton] == sender); - [controller_ closeAllBookmarkFolders]; - } - // Watch out for a modifier click. For example, command-click // should open all. // @@ -56,14 +47,17 @@ NSString* kBookmarkButtonDragType = @"ChromiumBookmarkButtonDragType"; WindowOpenDisposition disposition = event_utils::WindowOpenDispositionFromNSEvent([NSApp currentEvent]); if (disposition == NEW_BACKGROUND_TAB) { + [controller_ closeAllBookmarkFolders]; [controller_ openAll:[sender bookmarkNode] disposition:disposition]; return; } // If click on same folder, close it and be done. // Else we clicked on a different folder so more work to do. - if (same) + if ([[controller_ folderController] parentButton] == sender) { + [controller_ closeBookmarkFolder:controller_]; return; + } [controller_ addNewFolderControllerWithParentButton:sender]; } |