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

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

Issue 214083004: Prevents crash when a menu gets closed during drag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Prevents crash when a menu gets closed during drag (typo) Created 6 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
Index: ui/views/controls/menu/menu_host.cc
diff --git a/ui/views/controls/menu/menu_host.cc b/ui/views/controls/menu/menu_host.cc
index 5e8593b98ab06b57bc2e780541d1fe18b8f904b4..28fb95e02a612c2cd3dc59e24f7a4ee262e8a9cc 100644
--- a/ui/views/controls/menu/menu_host.cc
+++ b/ui/views/controls/menu/menu_host.cc
@@ -92,6 +92,10 @@ void MenuHost::DestroyMenuHost() {
destroying_ = true;
static_cast<MenuHostRootView*>(GetRootView())->ClearSubmenu();
Close();
+ // Since |submenu_| is not a child view it is necessary to notify its
+ // observers so that they can clean up the focus and drag and drop state.
+ View::ViewHierarchyChangedDetails details(false, NULL, submenu_, NULL);
+ ViewHierarchyChanged(details);
sky 2014/03/27 21:40:43 I think this is a deficiency in how focus is clean
varkha 2014/03/27 22:05:10 In this case the menu does not have focus (the men
sky 2014/03/27 23:31:28 Isn't this happening because SubmenuView is client
}
void MenuHost::SetMenuHostBounds(const gfx::Rect& bounds) {

Powered by Google App Engine
This is Rietveld 408576698