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

Unified Diff: ui/views/view.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/view.h ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 5c96c3cdde999c29e5d22245d941ddc22786d245..1ec3d9af338b8bcafbdae1cb0f431dbd1c3a6889 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -883,8 +883,7 @@ ui::EventResult View::OnTouchEvent(ui::TouchEvent* event) {
return ui::ER_UNHANDLED;
}
-ui::EventResult View::OnGestureEvent(ui::GestureEvent* event) {
- return ui::ER_UNHANDLED;
+void View::OnGestureEvent(ui::GestureEvent* event) {
}
ui::TextInputClient* View::GetTextInputClient() {
@@ -1999,10 +1998,10 @@ ui::EventResult View::ProcessTouchEvent(ui::TouchEvent* event) {
return OnTouchEvent(event);
}
-ui::EventResult View::ProcessGestureEvent(ui::GestureEvent* event) {
- ui::EventResult status = OnGestureEvent(event);
- if (status != ui::ER_UNHANDLED)
- return status;
+void View::ProcessGestureEvent(ui::GestureEvent* event) {
+ OnGestureEvent(event);
+ if (event->handled())
+ return;
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableTouchDragDrop)) {
@@ -2010,8 +2009,10 @@ ui::EventResult View::ProcessGestureEvent(ui::GestureEvent* event) {
(!drag_controller_ || drag_controller_->CanStartDragForView(
this, event->location(), event->location()))) {
if (DoDrag(*event, event->location(),
- ui::DragDropTypes::DRAG_EVENT_SOURCE_TOUCH))
- return ui::ER_CONSUMED;
+ ui::DragDropTypes::DRAG_EVENT_SOURCE_TOUCH)) {
+ event->StopPropagation();
+ return;
+ }
}
}
@@ -2022,9 +2023,8 @@ ui::EventResult View::ProcessGestureEvent(ui::GestureEvent* event) {
gfx::Point location(event->location());
ConvertPointToScreen(this, &location);
ShowContextMenu(location, true);
- return ui::ER_CONSUMED;
+ event->StopPropagation();
}
- return status;
}
// Accelerators ----------------------------------------------------------------
« no previous file with comments | « ui/views/view.h ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698