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

Unified Diff: ui/events/gesture_detection/gesture_provider.cc

Issue 2054193002: Android mouse events shouldn't appear as TouchEvents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Kept old touch-like behavior in pre-M. Created 4 years, 1 month 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/events/gesture_detection/gesture_provider.cc
diff --git a/ui/events/gesture_detection/gesture_provider.cc b/ui/events/gesture_detection/gesture_provider.cc
index b7cdb24bdd5fb685af84f3b4a29538ccdfb21286..9cb183b1aa4e4b36969062a0203b526f2cf8d40e 100644
--- a/ui/events/gesture_detection/gesture_provider.cc
+++ b/ui/events/gesture_detection/gesture_provider.cc
@@ -27,23 +27,28 @@ namespace {
const float kDoubleTapDragZoomSpeed = 0.005f;
const char* GetMotionEventActionName(MotionEvent::Action action) {
+
+#define CASE_ACTION_TO_STRING(action) \
aelias_OOO_until_Jul13 2016/11/09 02:43:14 I'm not a big fan of clever macro magic unless the
mustaq 2016/11/09 17:04:33 Done.
+ case MotionEvent::action: \
+ return #action;
+
switch (action) {
- case MotionEvent::ACTION_NONE:
- return "ACTION_NONE";
- case MotionEvent::ACTION_POINTER_DOWN:
- return "ACTION_POINTER_DOWN";
- case MotionEvent::ACTION_POINTER_UP:
- return "ACTION_POINTER_UP";
- case MotionEvent::ACTION_DOWN:
- return "ACTION_DOWN";
- case MotionEvent::ACTION_UP:
- return "ACTION_UP";
- case MotionEvent::ACTION_CANCEL:
- return "ACTION_CANCEL";
- case MotionEvent::ACTION_MOVE:
- return "ACTION_MOVE";
+ CASE_ACTION_TO_STRING(ACTION_NONE);
+ CASE_ACTION_TO_STRING(ACTION_POINTER_DOWN);
+ CASE_ACTION_TO_STRING(ACTION_POINTER_UP);
+ CASE_ACTION_TO_STRING(ACTION_DOWN);
+ CASE_ACTION_TO_STRING(ACTION_UP);
+ CASE_ACTION_TO_STRING(ACTION_CANCEL);
+ CASE_ACTION_TO_STRING(ACTION_MOVE);
+ CASE_ACTION_TO_STRING(ACTION_HOVER_ENTER);
+ CASE_ACTION_TO_STRING(ACTION_HOVER_EXIT);
+ CASE_ACTION_TO_STRING(ACTION_HOVER_MOVE);
+ CASE_ACTION_TO_STRING(ACTION_BUTTON_PRESS);
+ CASE_ACTION_TO_STRING(ACTION_BUTTON_RELEASE);
}
return "";
+
+#undef CASE_ACTION_TO_STRING
}
gfx::RectF ClampBoundingBox(const gfx::RectF& bounds,
@@ -853,6 +858,11 @@ void GestureProvider::OnTouchEventHandlingBegin(const MotionEvent& event) {
case MotionEvent::ACTION_MOVE:
break;
case MotionEvent::ACTION_NONE:
+ case MotionEvent::ACTION_HOVER_ENTER:
+ case MotionEvent::ACTION_HOVER_EXIT:
+ case MotionEvent::ACTION_HOVER_MOVE:
+ case MotionEvent::ACTION_BUTTON_PRESS:
+ case MotionEvent::ACTION_BUTTON_RELEASE:
NOTREACHED();
break;
}
@@ -881,6 +891,11 @@ void GestureProvider::OnTouchEventHandlingEnd(const MotionEvent& event) {
case MotionEvent::ACTION_MOVE:
break;
case MotionEvent::ACTION_NONE:
+ case MotionEvent::ACTION_HOVER_ENTER:
+ case MotionEvent::ACTION_HOVER_EXIT:
+ case MotionEvent::ACTION_HOVER_MOVE:
+ case MotionEvent::ACTION_BUTTON_PRESS:
+ case MotionEvent::ACTION_BUTTON_RELEASE:
NOTREACHED();
break;
}

Powered by Google App Engine
This is Rietveld 408576698