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

Issue 2778383002: MenuController Do Not SetSelection to Empty Items on Drag (Closed)

Created:
3 years, 8 months ago by jonross
Modified:
3 years, 8 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

MenuController Do Not SetSelection to Empty Items on Drag There is a Chrome crash caused by the following: - Menu opened - Submenu of the above opened, with only an empty menu item - Context menu nested above the empty menu item - A dragging right-click outside of the context menu, and within the empty menu item - Pressing ESC once the context menu has relaunched Empty menu items cannot be set as selection targets, and we do not allow arrow keys to select them. In a normal mouse over they are ignored. MenuController::OnMouseDragged however was not handling the result of GetMenuPart which signified an empty menu item. It would attempt to update the selection to an invalid state, and would hide the current menu. The subsequent OnMouseReleased would bring back the context menu, as the drag was only hiding the menu, not closing. The subsequent ESC key would then attempt to be processed by the invalid menu set in OnMouseDragged. This change update OnMouseDragged to properly ingore mouse targets of empty menu items. Bringing it inline with the behaviours of OnMouseMoved. TEST=MenuControllerTest.RepostEventToEmptyMenuItem BUG=704846 Review-Url: https://codereview.chromium.org/2778383002 Cr-Commit-Position: refs/heads/master@{#460449} Committed: https://chromium.googlesource.com/chromium/src/+/1f74ed2b7c59a6202072a0ceee38bbfb922bfb61

Patch Set 1 #

Total comments: 2

Patch Set 2 : fix test #

Patch Set 3 : Fix Windows Test #

Patch Set 4 : Make logic readible #

Unified diffs Side-by-side diffs Delta from patch set Stats (+182 lines, -11 lines) Patch
M ui/views/controls/menu/menu_controller.cc View 1 2 3 1 chunk +10 lines, -5 lines 0 comments Download
M ui/views/controls/menu/menu_controller_unittest.cc View 1 2 8 chunks +137 lines, -5 lines 0 comments Download
M ui/views/test/menu_test_utils.h View 3 chunks +21 lines, -1 line 0 comments Download
M ui/views/test/menu_test_utils.cc View 2 chunks +14 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (17 generated)
jonross
Hey sky@, I have a fix for a crash that was found in menus, dating ...
3 years, 8 months ago (2017-03-28 22:56:47 UTC) #4
sky
LGTM https://codereview.chromium.org/2778383002/diff/1/ui/views/controls/menu/menu_controller.cc File ui/views/controls/menu/menu_controller.cc (right): https://codereview.chromium.org/2778383002/diff/1/ui/views/controls/menu/menu_controller.cc#newcode630 ui/views/controls/menu/menu_controller.cc:630: if (!(!part.menu && part.submenu)) { This is rather ...
3 years, 8 months ago (2017-03-28 23:47:00 UTC) #7
jonross
https://codereview.chromium.org/2778383002/diff/1/ui/views/controls/menu/menu_controller.cc File ui/views/controls/menu/menu_controller.cc (right): https://codereview.chromium.org/2778383002/diff/1/ui/views/controls/menu/menu_controller.cc#newcode630 ui/views/controls/menu/menu_controller.cc:630: if (!(!part.menu && part.submenu)) { On 2017/03/28 23:47:00, sky ...
3 years, 8 months ago (2017-03-29 16:58:24 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2778383002/60001
3 years, 8 months ago (2017-03-29 16:59:03 UTC) #19
commit-bot: I haz the power
3 years, 8 months ago (2017-03-29 17:55:53 UTC) #22
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/1f74ed2b7c59a6202072a0ceee38...

Powered by Google App Engine
This is Rietveld 408576698