diff options
author | Kristian Monsen <kristianm@google.com> | 2011-05-31 20:30:28 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2011-06-14 20:31:41 -0700 |
commit | 72a454cd3513ac24fbdd0e0cb9ad70b86a99b801 (patch) | |
tree | 382278a54ce7a744d62fa510a9a80688cc12434b /chrome/browser/ui/cocoa/event_utils.mm | |
parent | c4becdd46e31d261b930e4b5a539cbc1d45c23a6 (diff) | |
download | external_chromium-72a454cd3513ac24fbdd0e0cb9ad70b86a99b801.zip external_chromium-72a454cd3513ac24fbdd0e0cb9ad70b86a99b801.tar.gz external_chromium-72a454cd3513ac24fbdd0e0cb9ad70b86a99b801.tar.bz2 |
Merge Chromium.org at r11.0.672.0: Initial merge by git.
Change-Id: I8b4aaf611a2a405fe3fe10e8a94ea7658645c192
Diffstat (limited to 'chrome/browser/ui/cocoa/event_utils.mm')
-rw-r--r-- | chrome/browser/ui/cocoa/event_utils.mm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/ui/cocoa/event_utils.mm b/chrome/browser/ui/cocoa/event_utils.mm index ec475b5..d471398 100644 --- a/chrome/browser/ui/cocoa/event_utils.mm +++ b/chrome/browser/ui/cocoa/event_utils.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/event_utils.h" +#include "chrome/browser/disposition_utils.h" + namespace event_utils { WindowOpenDisposition WindowOpenDispositionFromNSEvent(NSEvent* event) { @@ -13,9 +15,12 @@ WindowOpenDisposition WindowOpenDispositionFromNSEvent(NSEvent* event) { WindowOpenDisposition WindowOpenDispositionFromNSEventWithFlags( NSEvent* event, NSUInteger flags) { - if ([event buttonNumber] == 2 || flags & NSCommandKeyMask) - return flags & NSShiftKeyMask ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB; - return flags & NSShiftKeyMask ? NEW_WINDOW : CURRENT_TAB; + return disposition_utils::DispositionFromClick( + [event buttonNumber] == 2, + flags & NSAlternateKeyMask, + flags & NSControlKeyMask, + flags & NSCommandKeyMask, + flags & NSShiftKeyMask); } } // namespace event_utils |