Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Issue 866983006: MacViews: Intercept events for Menus (after AppKit has turned them into action messages). (Closed)

Created:
5 years, 11 months ago by tapted
Modified:
5 years, 10 months ago
Reviewers:
Andre, sky
CC:
chromium-reviews, tfarina, chrome-apps-syd-reviews_chromium.org, mac-views-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@20150127-MacViews-SendTextfieldToWindow-TEXTFIELD
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MacViews: Intercept events for Menus (after AppKit has turned them into action messages). Currently keystrokes while a menu is open are sent to the window hosting the menu, since it remains `key`. Menus are a different window, so this causes all the Menu* interactive_ui_tests to fail since they simulate pressing ESC to dismiss the menu in the tests. Other platforms insert an event dispatcher into the message pump for the nested run loop that shows a menu, and redirect KeyDown events to the MenuController. On Mac, events need to be mapped to "Action" messages by an NSResponder to obey platform behaviour and user customizations (e.g. a "Home" keypress should be interpreted as beginning of document, not beginning of line). The approach in this CL is to check in BridgedContentView, an NSResponder, for an active menu that should be receiving events instead. Action messages are mapped to the KeyCode that toolkit-views expects for that action, and the MenuController is given an opportunity to swallow the event or have it sent on to the key window. Gets the following interactive_ui_tests passing: MenuControllerMnemonicTest*{NoMatch,TitleMatch,MnemonicMatch} MenuItemViewTestRemoveWithSubmenu{0,1}* (and all Menu interactive UI tests pass after this). BUG=403679 Committed: https://crrev.com/370605a7ffb0392e48729591dc8f6fca79cdc987 Cr-Commit-Position: refs/heads/master@{#314711}

Patch Set 1 #

Patch Set 2 : rebase for r313520 #

Patch Set 3 : Nicer keycode/character handling. Fixes MenuMnemonic flakes #

Patch Set 4 : better IME handling #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+107 lines, -1 line) Patch
M ui/views/cocoa/bridged_content_view.mm View 1 2 3 4 chunks +52 lines, -1 line 0 comments Download
M ui/views/cocoa/native_widget_mac_nswindow.mm View 1 2 3 3 chunks +26 lines, -0 lines 0 comments Download
M ui/views/controls/menu/menu_controller.h View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M ui/views/controls/menu/menu_controller.cc View 1 2 2 chunks +22 lines, -0 lines 1 comment Download

Messages

Total messages: 11 (5 generated)
tapted
Hi Andre and sky - please take a look. Andre for general review/Mac, and sky ...
5 years, 10 months ago (2015-02-04 11:55:48 UTC) #5
sky
LGTM
5 years, 10 months ago (2015-02-04 18:43:24 UTC) #6
Andre
LGTM
5 years, 10 months ago (2015-02-04 19:26:52 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/866983006/120001
5 years, 10 months ago (2015-02-05 01:34:09 UTC) #9
commit-bot: I haz the power
Committed patchset #4 (id:120001)
5 years, 10 months ago (2015-02-05 01:38:54 UTC) #10
commit-bot: I haz the power
5 years, 10 months ago (2015-02-05 01:41:15 UTC) #11
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/370605a7ffb0392e48729591dc8f6fca79cdc987
Cr-Commit-Position: refs/heads/master@{#314711}

Powered by Google App Engine
This is Rietveld 408576698