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

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

Issue 395563002: Make RootView::DispatchGestureEvent() non-virtual (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed nit 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
« no previous file with comments | « ui/views/controls/menu/menu_host_root_view.h ('k') | ui/views/view_targeter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_host_root_view.cc
diff --git a/ui/views/controls/menu/menu_host_root_view.cc b/ui/views/controls/menu/menu_host_root_view.cc
index 3bce4a49b6e730c7bf2a08815af388948ca52107..a46b81b8327e1e10a37ab657eaa8eddefb515e24 100644
--- a/ui/views/controls/menu/menu_host_root_view.cc
+++ b/ui/views/controls/menu/menu_host_root_view.cc
@@ -55,15 +55,21 @@ bool MenuHostRootView::OnMouseWheel(const ui::MouseWheelEvent& event) {
GetMenuController()->OnMouseWheel(submenu_, event);
}
-void MenuHostRootView::DispatchGestureEvent(ui::GestureEvent* event) {
- RootView::DispatchGestureEvent(event);
- if (event->handled())
- return;
- // ChromeOS uses MenuController to forward events like other
- // mouse events.
- if (!GetMenuController())
- return;
- GetMenuController()->OnGestureEvent(submenu_, event);
+ui::EventDispatchDetails MenuHostRootView::OnEventFromSource(ui::Event* event) {
+ ui::EventDispatchDetails result = RootView::OnEventFromSource(event);
+
+ if (event->IsGestureEvent()) {
+ ui::GestureEvent* gesture_event = event->AsGestureEvent();
+ if (gesture_event->handled())
+ return result;
+ // ChromeOS uses MenuController to forward events like other
+ // mouse events.
+ if (!GetMenuController())
+ return result;
+ GetMenuController()->OnGestureEvent(submenu_, gesture_event);
+ }
+
+ return result;
}
MenuController* MenuHostRootView::GetMenuController() {
« no previous file with comments | « ui/views/controls/menu/menu_host_root_view.h ('k') | ui/views/view_targeter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698