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

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: 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_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..3c7d7a05da3a8dd8a673dde1679a067144e20bbd 100644
--- a/ui/views/controls/menu/menu_host_root_view.cc
+++ b/ui/views/controls/menu/menu_host_root_view.cc
@@ -55,15 +55,23 @@ 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) {
+ // TODO(tdanderson): Instead call up to EventProcessor::OnEventFromSource()
+ // once RootView::OnEventFromSource() is removed.
sadrul 2014/07/15 18:23:46 ditto
tdanderson 2014/07/15 20:25:40 Done.
+ ui::EventDispatchDetails result = RootView::OnEventFromSource(event);
+
+ if (event->IsGestureEvent()) {
+ ui::GestureEvent* gesture_event = static_cast<ui::GestureEvent*>(event);
+ 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() {

Powered by Google App Engine
This is Rietveld 408576698