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

Unified Diff: ui/views/controls/menu/menu_runner_impl.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 | « ui/views/controls/menu/menu_controller.cc ('k') | ui/views/controls/menu/menu_runner_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_runner_impl.cc
diff --git a/ui/views/controls/menu/menu_runner_impl.cc b/ui/views/controls/menu/menu_runner_impl.cc
index d02f7de1eff520e79f6e8dd96d6e8424522d3a2d..b48edcdd1291d33184e9bef72dd59955a8278938 100644
--- a/ui/views/controls/menu/menu_runner_impl.cc
+++ b/ui/views/controls/menu/menu_runner_impl.cc
@@ -88,8 +88,12 @@ MenuRunner::RunResult MenuRunnerImpl::RunMenuAt(Widget* parent,
if (!controller->IsBlockingRun()) {
controller->CancelAll();
controller = NULL;
+ } else {
+ // Only nest the delegate when not cancelling drag-and-drop. When
+ // cancelling this will become the root delegate of the new
+ // MenuController
+ controller->AddNestedDelegate(this);
}
- controller->AddNestedDelegate(this);
} else {
// There's some other menu open and we're not nested. Cancel the menu.
controller->CancelAll();
« no previous file with comments | « ui/views/controls/menu/menu_controller.cc ('k') | ui/views/controls/menu/menu_runner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698