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

Unified Diff: ui/views/controls/menu/menu_controller.cc

Issue 1834823002: Fix MenuRunnerImpl Crash for context menu during drag-and-drop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_runner_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_controller.cc
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index 23c2e1bc81e58b46ce0e6a7045d654181d3e07d6..886e7d2c9c92d079876d32d5367b07ce94b1888d 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -1194,7 +1194,9 @@ void MenuController::StartDrag(SubmenuView* source,
}
void MenuController::OnKeyDown(ui::KeyboardCode key_code) {
- DCHECK(blocking_run_);
+ // Do not process while performing drag-and-drop
+ if (!blocking_run_)
+ return;
switch (key_code) {
case ui::VKEY_UP:
@@ -2263,6 +2265,9 @@ void MenuController::AcceptOrSelect(MenuItemView* parent,
}
void MenuController::SelectByChar(base::char16 character) {
+ // Do not process while performing drag-and-drop
+ if (!blocking_run_)
+ return;
if (!character)
return;
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_runner_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698