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

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

Issue 552503003: Introduce EventProcessor::OnEventProcessingStarted() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sadrul comments addressed Created 6 years, 3 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/widget/root_view.h » ('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 a46b81b8327e1e10a37ab657eaa8eddefb515e24..1bc834a0098e5edb1a1fa41a163dd06712bfe7a6 100644
--- a/ui/views/controls/menu/menu_host_root_view.cc
+++ b/ui/views/controls/menu/menu_host_root_view.cc
@@ -55,21 +55,15 @@ bool MenuHostRootView::OnMouseWheel(const ui::MouseWheelEvent& event) {
GetMenuController()->OnMouseWheel(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;
+void MenuHostRootView::OnEventProcessingFinished(ui::Event* event) {
+ RootView::OnEventProcessingFinished(event);
+
+ // Forward unhandled gesture events to our menu controller.
+ // TODO(tdanderson): Investigate whether this should be moved into a
+ // post-target handler installed on |this| instead
+ // (invoked only if event->target() == this).
+ if (event->IsGestureEvent() && !event->handled() && GetMenuController())
+ GetMenuController()->OnGestureEvent(submenu_, event->AsGestureEvent());
}
MenuController* MenuHostRootView::GetMenuController() {
« no previous file with comments | « ui/views/controls/menu/menu_host_root_view.h ('k') | ui/views/widget/root_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698