summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-19 20:59:47 +0000
committerasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-19 20:59:47 +0000
commitf0d67158d5f26017c50d08ee206a8a7579bad1c8 (patch)
tree35df025ae4ad1f72b5930a355286b1ef0a65bfb0
parent109608b38a7622fc7330d5cf8074a998a052b48c (diff)
downloadchromium_src-f0d67158d5f26017c50d08ee206a8a7579bad1c8.zip
chromium_src-f0d67158d5f26017c50d08ee206a8a7579bad1c8.tar.gz
chromium_src-f0d67158d5f26017c50d08ee206a8a7579bad1c8.tar.bz2
[Mac] Support command-clicking in context menus.
BUG=110473 TEST=Right click on some text on the web. Command-click the "Search Google for ..." option in the menu. The Google search tab should open in the background. Review URL: http://codereview.chromium.org/9159015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118353 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/cocoa/menu_controller.mm9
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/browser/ui/cocoa/menu_controller.mm b/chrome/browser/ui/cocoa/menu_controller.mm
index 7af0a5b..fbeb9db 100644
--- a/chrome/browser/ui/cocoa/menu_controller.mm
+++ b/chrome/browser/ui/cocoa/menu_controller.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/sys_string_conversions.h"
+#import "chrome/browser/ui/cocoa/event_utils.h"
#include "skia/ext/skia_utils_mac.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/accelerators/accelerator_cocoa.h"
@@ -179,8 +180,10 @@
static_cast<ui::MenuModel*>(
[[sender representedObject] pointerValue]);
DCHECK(model);
- if (model)
- model->ActivatedAt(modelIndex);
+ if (model) {
+ int event_flags = event_utils::EventFlagsFromNSEvent([NSApp currentEvent]);
+ model->ActivatedAt(modelIndex, event_flags);
+ }
}
- (NSMenu*)menu {