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/history_menu_cocoa_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/history_menu_cocoa_controller.mm')
-rw-r--r-- | chrome/browser/cocoa/history_menu_cocoa_controller.mm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/history_menu_cocoa_controller.mm b/chrome/browser/cocoa/history_menu_cocoa_controller.mm index ac69916..b6523ab 100644 --- a/chrome/browser/cocoa/history_menu_cocoa_controller.mm +++ b/chrome/browser/cocoa/history_menu_cocoa_controller.mm @@ -10,7 +10,8 @@ #include "chrome/browser/history/history.h" #include "chrome/browser/history/history_types.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "webkit/glue/window_open_disposition.h" // CURRENT_TAB +#import "chrome/common/cocoa_utils.h" +#include "webkit/glue/window_open_disposition.h" @implementation HistoryMenuCocoaController @@ -35,7 +36,9 @@ DCHECK(tab_contents); // A TabContents is a PageNavigator, so we can OpenURL() on it. - tab_contents->OpenURL(node.url, GURL(), CURRENT_TAB, + WindowOpenDisposition disposition = event_utils::DispositionFromEventFlags( + [[NSApp currentEvent] modifierFlags]); + tab_contents->OpenURL(node.url, GURL(), disposition, PageTransition::AUTO_BOOKMARK); } |