diff --git a/chrome/browser/ui/cocoa/fast_resize_view.mm b/chrome/browser/ui/cocoa/fast_resize_view.mm index b5bfb1ea..82c0b72 100644 --- a/chrome/browser/ui/cocoa/fast_resize_view.mm +++ b/chrome/browser/ui/cocoa/fast_resize_view.mm
@@ -27,5 +27,14 @@ return YES; } +// Override -[NSView hitTest:] to prevent mouse events reaching subviews while +// the window is displaying a modal sheet. Without this, context menus can be +// shown on a right-click and trigger all kinds of things (e.g. Print). +- (NSView*)hitTest:(NSPoint)aPoint { + if ([[self window] attachedSheet]) + return self; + return [super hitTest:aPoint]; +} + @end
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm index a926054..17bca3c 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm
@@ -227,6 +227,17 @@ return YES; } +// When displaying a modal sheet, interaction with the tabs (e.g. middle-click +// to close a tab) should be blocked. -[NSWindow sendEvent] blocks left-click, +// but not others. To prevent clicks going to subviews, absorb them here. This +// is also done in FastResizeView, but TabStripView is in the title bar, so is +// not contained in a FastResizeView. +- (NSView*)hitTest:(NSPoint)aPoint { + if ([[self window] attachedSheet]) + return self; + return [super hitTest:aPoint]; +} + // Trap double-clicks and make them miniaturize the browser window. - (void)mouseUp:(NSEvent*)event { // Bail early if double-clicks are disabled.
diff --git a/chrome/browser/ui/cocoa/tabs/tab_view.mm b/chrome/browser/ui/cocoa/tabs/tab_view.mm index b4a2f242..007e7d49 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_view.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_view.mm
@@ -200,11 +200,6 @@ if ([self isClosing]) return nil; - // Sheets, being window-modal, should block contextual menus. For some reason - // they do not. Disallow them ourselves. - if ([[self window] attachedSheet]) - return nil; - return [controller_ menu]; }
diff --git a/extensions/common/api/virtual_keyboard_private.json b/extensions/common/api/virtual_keyboard_private.json index 5b335fb..ac6775b3 100644 --- a/extensions/common/api/virtual_keyboard_private.json +++ b/extensions/common/api/virtual_keyboard_private.json
@@ -160,6 +160,10 @@ "minLength": 1, "description": "Virtual keyboard layout string." }, + "hotrodmode": { + "type": "boolean", + "description": "Virtual keyboard is in hotrod mode." + }, "a11ymode": { "type": "boolean", "description": "True if accessibility virtual keyboard is enabled."