diff options
author | asvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-03 22:16:31 +0000 |
---|---|---|
committer | asvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-03 22:16:31 +0000 |
commit | ab317d767604aec71fec42b053c09024ab1328d4 (patch) | |
tree | f2951438b2bc41f7905a2a941e3d335ac746f720 /chrome/browser | |
parent | 609726b17bb0e50dba0de1afd3487180fea9d303 (diff) | |
download | chromium_src-ab317d767604aec71fec42b053c09024ab1328d4.zip chromium_src-ab317d767604aec71fec42b053c09024ab1328d4.tar.gz chromium_src-ab317d767604aec71fec42b053c09024ab1328d4.tar.bz2 |
[Mac] Fix BMB folder menu staying open after a drive-through drag over.
BUG=87092
TEST=Add some folders to the BMB and make sure it's visible. Drag a link from a web page. Hover long enough over a BMB folder for the menu to open, then drag up into the tabstrip. When the drag enters the tabstrip, the open BMB folder menu should close.
Review URL: http://codereview.chromium.org/8438036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm | 10 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm index cdd1e60..ed0a383 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm @@ -2444,6 +2444,16 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) { } - (void)draggingExited:(id<NSDraggingInfo>)info { + // Only close the folder menu if the user dragged up past the BMB. If the user + // dragged to below the BMB, they might be trying to drop a link into the open + // folder menu. + // TODO(asvitkine): Need a way to close the menu if the user dragged below but + // not into the menu. + NSRect bounds = [[self view] bounds]; + NSPoint origin = [[self view] convertPoint:bounds.origin toView:nil]; + if ([info draggingLocation].y > origin.y + bounds.size.height) + [self closeFolderAndStopTrackingMenus]; + // NOT the same as a cancel --> we may have moved the mouse into the submenu. if (hoverButton_) { [NSObject cancelPreviousPerformRequestsWithTarget:[hoverButton_ target]]; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm index b1e0810..e0e6614 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm @@ -165,6 +165,8 @@ } - (void)draggingExited:(id<NSDraggingInfo>)info { + [controller_ draggingExited:info]; + // Regardless of the type of dragging which ended, we need to get rid of the // drop indicator if one was shown. if (dropIndicatorShown_) { @@ -174,6 +176,8 @@ } - (void)draggingEnded:(id<NSDraggingInfo>)info { + [controller_ draggingEnded:info]; + [[BookmarkButton draggedButton] setHidden:NO]; if (dropIndicatorShown_) { dropIndicatorShown_ = NO; |