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

Unified Diff: ui/aura/event_filter.cc

Issue 10964051: events: Clean up dispatching code for touch-events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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
Index: ui/aura/event_filter.cc
diff --git a/ui/aura/event_filter.cc b/ui/aura/event_filter.cc
index d7f4719b468595fe4efca8f027da50c226829383..0e56533b73fab1257aa8de114e20f3d9f2c7d483 100644
--- a/ui/aura/event_filter.cc
+++ b/ui/aura/event_filter.cc
@@ -41,8 +41,25 @@ ui::EventResult EventFilter::OnScrollEvent(ui::ScrollEvent* event) {
return ui::ER_UNHANDLED;
}
-ui::TouchStatus EventFilter::OnTouchEvent(ui::TouchEvent* event) {
- return PreHandleTouchEvent(static_cast<Window*>(event->target()), event);
+ui::EventResult EventFilter::OnTouchEvent(ui::TouchEvent* event) {
+ ui::TouchStatus status = PreHandleTouchEvent(
+ static_cast<Window*>(event->target()), event);
+ switch (status) {
+ case ui::TOUCH_STATUS_UNKNOWN:
+ return ui::ER_UNHANDLED;
+
+ case ui::TOUCH_STATUS_START:
+ case ui::TOUCH_STATUS_CONTINUE:
+ case ui::TOUCH_STATUS_END:
+ return ui::ER_CONSUMED;
+
+ case ui::TOUCH_STATUS_QUEUED:
+ case ui::TOUCH_STATUS_QUEUED_END:
+ return ui::ER_ASYNC;
+ }
+
+ NOTREACHED();
+ return ui::ER_UNHANDLED;
}
ui::EventResult EventFilter::OnGestureEvent(ui::GestureEvent* event) {

Powered by Google App Engine
This is Rietveld 408576698