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

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

Issue 378333003: Allow menus to stay open during a child view's drag and drop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 2716ec8bb782c1a46288c0ab449d80a2a96e2caf..90192405a667c0d7ab15544ca57d70b584120aea 100644
--- a/ui/views/controls/menu/menu_host.cc
+++ b/ui/views/controls/menu/menu_host.cc
@@ -110,8 +110,11 @@ void MenuHost::OnMouseCaptureLost() {
return;
MenuController* menu_controller =
submenu_->GetMenuItem()->GetMenuController();
- if (menu_controller && !menu_controller->drag_in_progress())
+ if (menu_controller &&
+ !menu_controller->drag_in_progress() &&
+ !dragged_view()) {
sky 2014/07/11 17:45:33 Document why we check dragged_view(). I also midly
Devlin 2014/07/11 18:43:51 If we forward a OnDragWillStart() down to MenuCont
sky 2014/07/11 19:15:20 Yes, I believe you are right.
menu_controller->CancelAll();
+ }
Widget::OnMouseCaptureLost();
}
@@ -135,4 +138,10 @@ void MenuHost::OnOwnerClosing() {
menu_controller->CancelAll();
}
+void MenuHost::OnDragComplete() {
+ // During a view's drag, we may have lost the capture. Reset it so that we
sky 2014/07/11 17:45:33 Add a delegate method as to what should happen whe
Devlin 2014/07/11 18:43:51 Done. However, this has a side-effect: other drag
sky 2014/07/11 19:15:20 Good point. I don't believe the bookmark code does
Devlin 2014/07/11 20:28:15 Tentatively done (see comment on new patch set).
+ // get OnMouseCaptureLost events.
+ native_widget_private()->SetCapture();
+}
+
} // namespace views

Powered by Google App Engine
This is Rietveld 408576698