summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-10 17:31:05 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-10 17:31:05 +0000
commit98f83b3d9b3b8499ad1fef2c2ec007b5fa4debc8 (patch)
tree8a58d426496be958a70efe5e3f22db80bac209f4 /chrome/browser/cocoa
parentba70d082593f9e20ab059b7f09495d94c0856005 (diff)
downloadchromium_src-98f83b3d9b3b8499ad1fef2c2ec007b5fa4debc8.zip
chromium_src-98f83b3d9b3b8499ad1fef2c2ec007b5fa4debc8.tar.gz
chromium_src-98f83b3d9b3b8499ad1fef2c2ec007b5fa4debc8.tar.bz2
When holding command and moving/scrolling over folders on bookmark folder menu, don't "open all".
BUG=http://crbug.com/52488 TEST= 1) Confirm command-click on a folder still does OpenAllInNewTab. 2) Open a folder than has subfolders with bookmarks in them. Hold command and move mouse slowly across the folder. Make sure an "open all" is NOT triggered. Review URL: http://codereview.chromium.org/3329021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59110 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/bookmark_folder_target.mm18
1 files changed, 16 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/bookmark_folder_target.mm b/chrome/browser/cocoa/bookmark_folder_target.mm
index 2380b49..1aac77f 100644
--- a/chrome/browser/cocoa/bookmark_folder_target.mm
+++ b/chrome/browser/cocoa/bookmark_folder_target.mm
@@ -43,10 +43,24 @@ NSString* kBookmarkButtonDragType = @"ChromiumBookmarkButtonDragType";
// NOTE: we cannot use [[sender cell] mouseDownFlags] because we
// thwart the normal mouse click mechanism to make buttons
// draggable. Thus we must use [NSApp currentEvent].
+ //
+ // Holding command while using the scroll wheel (or moving around
+ // over a bookmark folder) can confuse us. Unless we check the
+ // event type, we are not sure if this is an "open folder" due to a
+ // hover-open or "open folder" due to a click. It doesn't matter
+ // (both do the same thing) unless a modifier is held, since
+ // command-click should "open all" but command-move should not.
+ // WindowOpenDispositionFromNSEvent does not consider the event
+ // type; only the modifiers. Thus the need for an extra
+ // event-type-check here.
DCHECK([sender bookmarkNode]->is_folder());
+ NSEvent* event = [NSApp currentEvent];
WindowOpenDisposition disposition =
- event_utils::WindowOpenDispositionFromNSEvent([NSApp currentEvent]);
- if (disposition == NEW_BACKGROUND_TAB) {
+ event_utils::WindowOpenDispositionFromNSEvent(event);
+ if (([event type] != NSMouseEntered) &&
+ ([event type] != NSMouseMoved) &&
+ ([event type] != NSScrollWheel) &&
+ (disposition == NEW_BACKGROUND_TAB)) {
[controller_ closeAllBookmarkFolders];
[controller_ openAll:[sender bookmarkNode] disposition:disposition];
return;