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

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

Issue 11280290: events: Change gesture-event handler in EventHandler to not return any values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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_controller.h ('k') | ui/views/controls/menu/menu_host_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_controller.cc
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index 1cbb70f0faf2d74481cd9dc76732623b96314375..d6aecd17ea0a26a51809cc660a1336fad0bd7bb6 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -506,17 +506,16 @@ bool MenuController::OnMouseWheel(SubmenuView* source,
}
#endif
-ui::EventResult MenuController::OnGestureEvent(
- SubmenuView* source,
- ui::GestureEvent* event) {
+void MenuController::OnGestureEvent(SubmenuView* source,
+ ui::GestureEvent* event) {
MenuPart part = GetMenuPart(source, event->location());
if (event->type() == ui::ET_GESTURE_TAP_DOWN) {
SetSelectionOnPointerDown(source, *event);
- return ui::ER_CONSUMED;
+ event->StopPropagation();
} else if (event->type() == ui::ET_GESTURE_LONG_PRESS) {
if (part.type == MenuPart::MENU_ITEM && part.menu) {
if (ShowContextMenu(part.menu, source, *event))
- return ui::ER_CONSUMED;
+ event->StopPropagation();
}
} else if (event->type() == ui::ET_GESTURE_TAP) {
if (!part.is_scroll() && part.menu &&
@@ -525,17 +524,20 @@ ui::EventResult MenuController::OnGestureEvent(
part.menu, *event)) {
Accept(part.menu, 0);
}
- return ui::ER_CONSUMED;
+ event->StopPropagation();
} else if (part.type == MenuPart::MENU_ITEM) {
// User either tapped on empty space, or a menu that has children.
SetSelection(part.menu ? part.menu : state_.item,
SELECTION_OPEN_SUBMENU | SELECTION_UPDATE_IMMEDIATELY);
- return ui::ER_CONSUMED;
+ event->StopPropagation();
}
}
+ if (event->stopped_propagation())
+ return;
+
if (!part.submenu)
- return ui::ER_UNHANDLED;
- return part.submenu->OnGestureEvent(event);
+ return;
+ part.submenu->OnGestureEvent(event);
}
bool MenuController::GetDropFormats(
« no previous file with comments | « ui/views/controls/menu/menu_controller.h ('k') | ui/views/controls/menu/menu_host_root_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698