Chromium Code Reviews| Index: chrome/browser/chrome_browser_application_mac.mm |
| diff --git a/chrome/browser/chrome_browser_application_mac.mm b/chrome/browser/chrome_browser_application_mac.mm |
| index e648774a16a5bc68567109486ab69b097578272b..118e99201f887b8b4f003300df7d0116e453e9f7 100644 |
| --- a/chrome/browser/chrome_browser_application_mac.mm |
| +++ b/chrome/browser/chrome_browser_application_mac.mm |
| @@ -5,6 +5,7 @@ |
| #import "chrome/browser/chrome_browser_application_mac.h" |
| #import "base/auto_reset.h" |
| +#include "base/command_line.h" |
| #include "base/debug/crash_logging.h" |
| #include "base/debug/stack_trace.h" |
| #import "base/logging.h" |
| @@ -17,6 +18,7 @@ |
| #import "base/strings/sys_string_conversions.h" |
| #import "chrome/browser/app_controller_mac.h" |
| #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" |
| +#include "chrome/common/chrome_switches.h" |
| #include "chrome/common/crash_keys.h" |
| #import "chrome/common/mac/objc_zombie.h" |
| #include "content/public/browser/browser_accessibility_state.h" |
| @@ -487,8 +489,19 @@ void SwizzleInit() { |
| tracked_objects::ScopedTracker tracking_profile( |
| FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| "463272 -[BrowserCrApplication sendEvent:] Mouse")); |
| - base::mac::ScopedSendingEvent sendingEventScoper; |
| - [super sendEvent:event]; |
| + |
| + const bool isLeftMouseMenu = (event.type == NSLeftMouseDown) && |
|
Dan Beam
2015/06/25 00:36:15
nit: event.type == NSLeftMouseDown &&
(no need fo
frederic.jacob.78
2015/06/25 22:25:34
Done.
|
| + ([event modifierFlags] & NSControlKeyMask); |
| + |
| + // In kiosk mode, we want to prevent context menus from appearing, |
| + // so simply discard menu-generating events instead of passing them along. |
| + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kKioskMode) || |
| + ((event.type != NSRightMouseDown) && |
|
Dan Beam
2015/06/25 00:36:15
same: extra parens
frederic.jacob.78
2015/06/25 22:25:34
Done.
|
| + !isLeftMouseMenu)) { |
| + base::mac::ScopedSendingEvent sendingEventScoper; |
| + [super sendEvent:event]; |
| + } |
| break; |
| } |