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

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

Issue 1565013002: Don't send touch events to windows like menus when the touch occurs outside the menu bounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build redness Created 4 years, 11 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.h
diff --git a/ui/views/controls/menu/menu_controller.h b/ui/views/controls/menu/menu_controller.h
index b550ad75ba57883ff1a6d25eab4af80d6a2a4306..1d799bd952f3167e7e6061fba6ca1a52c04e0601 100644
--- a/ui/views/controls/menu/menu_controller.h
+++ b/ui/views/controls/menu/menu_controller.h
@@ -151,6 +151,7 @@ class VIEWS_EXPORT MenuController : public WidgetObserver {
void OnMouseEntered(SubmenuView* source, const ui::MouseEvent& event);
bool OnMouseWheel(SubmenuView* source, const ui::MouseWheelEvent& event);
void OnGestureEvent(SubmenuView* source, ui::GestureEvent* event);
+ void OnTouchEvent(SubmenuView* source, ui::TouchEvent* event);
View* GetTooltipHandlerForPoint(SubmenuView* source, const gfx::Point& point);
void ViewHierarchyChanged(SubmenuView* source,
const View::ViewHierarchyChangedDetails& details);
@@ -306,8 +307,11 @@ class VIEWS_EXPORT MenuController : public WidgetObserver {
// to show/hide submenus and update state_.
void SetSelection(MenuItemView* menu_item, int types);
+ // The |EventType| template argument indicates the type of the event.
+ // For e.g. MouseEvent, TouchEvent, etc.
+ template<class EventType>
void SetSelectionOnPointerDown(SubmenuView* source,
- const ui::LocatedEvent& event);
+ const EventType& event);
void StartDrag(SubmenuView* source, const gfx::Point& location);
// Key processing.
@@ -502,7 +506,10 @@ class VIEWS_EXPORT MenuController : public WidgetObserver {
// On non-aura Windows, a new mouse event is generated and posted to
// the window (if there is one) at the location of the event. On
// aura, the event is reposted on the RootWindow.
- void RepostEvent(SubmenuView* source, const ui::LocatedEvent& event);
+ // The |EventType| template argument indicates the type of the event.
+ // For e.g. MouseEvent, TouchEvent, etc.
+ template<class EventType>
sky 2016/01/12 21:16:42 I'm not seeing why you need the template args.
ananta 2016/01/13 01:21:24 Replaced with LocatedEvent* here and other places.
+ void RepostEvent(SubmenuView* source, const EventType& event);
// Sets the drop target to new_item.
void SetDropMenuItem(MenuItemView* new_item,

Powered by Google App Engine
This is Rietveld 408576698