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

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

Issue 2876203003: Make shelf item can be dragged when context menu is opened.
Patch Set: Created 3 years, 7 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_controller.cc
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index a5ecb7df05c4a3fc1bda4e00ee870b38a24475e9..a57f16f89c50d30aea40769780ad0c8d82123f95 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -820,8 +820,12 @@ void MenuController::OnGestureEvent(SubmenuView* source,
if (event->stopped_propagation())
return;
- if (!part.submenu)
+ if (!part.submenu) {
+ event->ConvertLocationToTarget(source->GetWidget()->GetNativeWindow(),
+ owner()->GetNativeWindow());
+ owner()->OnGestureEvent(event);
return;
+ }
xiyuan 2017/05/12 20:24:56 nit: revist to something like if (part.submenu) {
part.submenu->OnGestureEvent(event);
}
@@ -1824,7 +1828,8 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
// Menus are the only place using kGroupingPropertyKey, so any value (other
// than 0) is fine.
const int kGroupingId = 1001;
- item->GetSubmenu()->ShowAt(owner_, bounds, do_capture);
+ item->GetSubmenu()->ShowAt(owner_, bounds, do_capture,
+ cancel_active_touches_);
item->GetSubmenu()->GetWidget()->SetNativeWindowProperty(
TooltipManager::kGroupingPropertyKey,
reinterpret_cast<void*>(kGroupingId));

Powered by Google App Engine
This is Rietveld 408576698