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

Issue 1625313002: Remove MenuMessagePumpDispatcher (Closed)

Created:
4 years, 11 months ago by mohsen
Modified:
4 years, 10 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove MenuMessagePumpDispatcher MenuMessagePumpDispatcher is used on Windows to handle keyboard events and some other events in menu message loops. In order to have fully async menus, we need to get rid of it. Instead, we can use MenuKeyEventHandler which is used on Chrome OS and Linux with some modifications. Following are messages that are handled in MenuMessagePumpDispatcher and how they can be handled after removing this class: - WM_KEYDOWN: This will be handled in MenuKeyEventHandler::OnKeyEvent. - WM_CHAR: This is used to handle "translated" characters for mnemonics according to the active keyboard layout. We can achieve this in MenuKeyEventHandler by using event->GetCharacter() instead of ui::DomCodeToUsLayoutCharacter(). - WM_SYSKEYDOWN: This happens when Alt or F10 keys are pressed (according to MSDN). We can handle these keys in MenuKeyEventHandler. - WM_CANCELMODE: This is already handled in ActivationChangeObserverImpl::OnCancelMode() which is used in MenuMessageLoopAura. BUG=564255, 566019 Committed: https://crrev.com/0df5837131a55ff6560a80b181ef90e620ea8092 Cr-Commit-Position: refs/heads/master@{#371894}

Patch Set 1 #

Patch Set 2 : Fixed gyp file #

Patch Set 3 : Added tests for Alt/F10 #

Patch Set 4 : Added test for cancel mode #

Total comments: 2

Patch Set 5 : Replaced typedef with using #

Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -140 lines) Patch
M chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc View 1 2 3 4 2 chunks +91 lines, -0 lines 0 comments Download
M ui/views/controls/menu/menu_controller.h View 2 chunks +0 lines, -2 lines 0 comments Download
M ui/views/controls/menu/menu_controller.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M ui/views/controls/menu/menu_key_event_handler.cc View 2 chunks +1 line, -2 lines 0 comments Download
M ui/views/controls/menu/menu_message_loop_aura.cc View 3 chunks +1 line, -26 lines 0 comments Download
D ui/views/controls/menu/menu_message_pump_dispatcher_win.h View 1 chunk +0 lines, -38 lines 0 comments Download
D ui/views/controls/menu/menu_message_pump_dispatcher_win.cc View 1 chunk +0 lines, -70 lines 0 comments Download
M ui/views/views.gyp View 1 1 chunk +0 lines, -2 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 18 (6 generated)
mohsen
Please take a look...
4 years, 11 months ago (2016-01-25 04:59:51 UTC) #2
sky
I'm pretty sure we do, but just to make sure you verified it. Do we ...
4 years, 11 months ago (2016-01-25 17:23:12 UTC) #3
mohsen
There are a few tests testing basic keyboard functionality for menus including arrow keys and ...
4 years, 11 months ago (2016-01-26 04:38:08 UTC) #4
sky
I can only think to use alt-tab, but I suspect that would introduce flake. So, ...
4 years, 11 months ago (2016-01-26 04:54:11 UTC) #5
mohsen
In Alt-Tab, as soon as you press down Alt key, menu gets hidden, so it ...
4 years, 11 months ago (2016-01-26 05:37:32 UTC) #6
mohsen
Can we send WM_CANCELMODE to the HWND explicitly in a test?
4 years, 11 months ago (2016-01-26 05:47:48 UTC) #7
sky
You can probably send WM_CANCELMODE via PostMessage/SendMessage. On Mon, Jan 25, 2016 at 9:47 PM, ...
4 years, 10 months ago (2016-01-26 14:19:45 UTC) #8
mohsen
OK. I've added tests for Alt/F10 and WM_CANCELMODE. Please take a look...
4 years, 10 months ago (2016-01-27 02:01:57 UTC) #10
sky
LGTM https://codereview.chromium.org/1625313002/diff/80001/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc File chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc (right): https://codereview.chromium.org/1625313002/diff/80001/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc#newcode2288 chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc:2288: typedef BookmarkBarViewTest25<ui::VKEY_F10> BookmarkBarViewTest25F10; nit: using https://codereview.chromium.org/1625313002/diff/80001/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc#newcode2292 chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc:2292: typedef ...
4 years, 10 months ago (2016-01-27 17:53:41 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1625313002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1625313002/100001
4 years, 10 months ago (2016-01-27 22:15:11 UTC) #15
commit-bot: I haz the power
Committed patchset #5 (id:100001)
4 years, 10 months ago (2016-01-27 22:22:54 UTC) #16
commit-bot: I haz the power
4 years, 10 months ago (2016-01-27 22:23:46 UTC) #18
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/0df5837131a55ff6560a80b181ef90e620ea8092
Cr-Commit-Position: refs/heads/master@{#371894}

Powered by Google App Engine
This is Rietveld 408576698