diff options
author | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-18 16:58:08 +0000 |
---|---|---|
committer | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-18 16:58:08 +0000 |
commit | 357226a1f9f615379a0add23fb8c81a7f598c282 (patch) | |
tree | 16ab65ecad0ae46e903403f5fb17958aeda56712 /chrome/browser/cocoa/infobar_controller.mm | |
parent | 457f5cf27e7b74c5e6d161015532794f2ae88365 (diff) | |
download | chromium_src-357226a1f9f615379a0add23fb8c81a7f598c282.zip chromium_src-357226a1f9f615379a0add23fb8c81a7f598c282.tar.gz chromium_src-357226a1f9f615379a0add23fb8c81a7f598c282.tar.bz2 |
Add modifier key support for window open dispositions throught the Mac UI
* Add cocoa_utils.{h,mm} and a unit test for the one method it contains:
event_utils::DispositionFromEventFlags().
* Add modifier key support to the history menu, bookmark menu, infobars,
bookmark bar, and Omnibox.
BUG=17912,17301
TEST=When using the aforementioned UI elements, Cmd should open in new
foreground tab, Cmd+Shift should open in new background tab, and Shift should
open in a new window.
Patch by Robert Sesek.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23636 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/infobar_controller.mm')
-rw-r--r-- | chrome/browser/cocoa/infobar_controller.mm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/infobar_controller.mm b/chrome/browser/cocoa/infobar_controller.mm index f887cf8..ea496de 100644 --- a/chrome/browser/cocoa/infobar_controller.mm +++ b/chrome/browser/cocoa/infobar_controller.mm @@ -11,6 +11,7 @@ #import "chrome/browser/cocoa/infobar_container_controller.h" #import "chrome/browser/cocoa/infobar_controller.h" #include "chrome/browser/tab_contents/tab_contents.h" +#import "chrome/common/cocoa_utils.h" #include "skia/ext/skia_utils_mac.h" #include "webkit/glue/window_open_disposition.h" @@ -176,8 +177,8 @@ // is called by the InfobarTextField on its delegate (the // LinkInfoBarController). - (void)linkClicked { - // TODO(rohitrao): Set the disposition correctly based on modifier keys. - WindowOpenDisposition disposition = CURRENT_TAB; + WindowOpenDisposition disposition = event_utils::DispositionFromEventFlags( + [[NSApp currentEvent] modifierFlags]); if (delegate_->AsLinkInfoBarDelegate()->LinkClicked(disposition)) [self closeInfoBar]; } |