Commit ba1a0e92 authored by Edin Kadric's avatar Edin Kadric Committed by Commit Bot

Fix issue where we accessed MenuController after deleting it.

This was introduced in crrev.com/c/1466186 which didn't return right
after the potential call to CancelAll anymore. Instead it would try to
access a member variable and cause a crash.

Bug: 937206
Change-Id: I26a210d464e1c57b071f599e64bcb68a09a16c54
Reviewed-on: https://chromium-review.googlesource.com/c/1496557Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Edin Kadric <edinkadric@google.com>
Cr-Commit-Position: refs/heads/master@{#636964}
parent 8da9f11a
......@@ -1183,8 +1183,11 @@ ui::PostDispatchAction MenuController::OnWillDispatchKeyEvent(
ViewsDelegate::ProcessMenuAcceleratorResult result =
ViewsDelegate::GetInstance()->ProcessAcceleratorWhileMenuShowing(
accelerator);
if (result == ViewsDelegate::ProcessMenuAcceleratorResult::CLOSE_MENU)
if (result == ViewsDelegate::ProcessMenuAcceleratorResult::CLOSE_MENU) {
CancelAll();
event->StopPropagation();
return ui::POST_DISPATCH_NONE;
}
if (IsEditableCombobox()) {
const base::flat_set<ui::KeyboardCode> kKeysThatDontPropagate = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment