summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-17 20:50:29 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-17 20:50:29 +0000
commit3698f173be9c6bf67816ad7e1ec194dd83438cba (patch)
treedd95954931d37a7183881dda2778d0f14d9d7e7e /chrome/browser/cocoa
parent4462559524df6726acc2400113508f3dc22b3648 (diff)
downloadchromium_src-3698f173be9c6bf67816ad7e1ec194dd83438cba.zip
chromium_src-3698f173be9c6bf67816ad7e1ec194dd83438cba.tar.gz
chromium_src-3698f173be9c6bf67816ad7e1ec194dd83438cba.tar.bz2
[Mac] Honor modifier keys in back/forward menu.
Add a method ActivatedAtWithDisposition to BackForwardMenuModel that navigates to a history item with a certain window disposition (current tab, new background/foreground tab). Change BackForwardMenuController to call ActivatedAtWithDisposition with the disposition created from the current NSEvent. Also, factor out some common code in Browser::GoBack and GoForward. BUG=37984 TEST=Navigate to a history item in the back/forward menu while holding down the command key. The item should open in a new tab. Likewise, holding down cmd-shift should open it in a new foreground tab. Review URL: http://codereview.chromium.org/910001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41875 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/back_forward_menu_controller.mm5
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/back_forward_menu_controller.mm b/chrome/browser/cocoa/back_forward_menu_controller.mm
index 41585bc..2fca91d 100644
--- a/chrome/browser/cocoa/back_forward_menu_controller.mm
+++ b/chrome/browser/cocoa/back_forward_menu_controller.mm
@@ -9,6 +9,7 @@
#include "base/sys_string_conversions.h"
#include "chrome/browser/back_forward_menu_model.h"
#import "chrome/browser/cocoa/delayedmenu_button.h"
+#import "chrome/browser/cocoa/event_utils.h"
#include "skia/ext/skia_utils_mac.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -93,7 +94,9 @@ using gfx::SkBitmapToNSImage;
- (void)executeMenuItem:(id)sender {
DCHECK([sender isKindOfClass:[NSMenuItem class]]);
int menuID = [sender tag];
- model_->ActivatedAt(menuID);
+ model_->ActivatedAtWithDisposition(
+ menuID,
+ event_utils::WindowOpenDispositionFromNSEvent([NSApp currentEvent]));
}
@end // @implementation BackForwardMenuController