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

Unified Diff: ash/touch/touch_uma.cc

Issue 302463004: Implementing the dispatch of the swipe gesture for one-finger touch swipes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing review feedback and also rebasing to resolve conflicts. Created 6 years, 7 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 | « no previous file | ash/wm/gestures/overview_gesture_handler.cc » ('j') | ash/wm/toplevel_window_event_handler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/touch/touch_uma.cc
diff --git a/ash/touch/touch_uma.cc b/ash/touch/touch_uma.cc
index db9f07e1b215e6e33505d995e7a390030d24ee3b..c9672018974db20ea5923205eb6ec2122f90ed9f 100644
--- a/ash/touch/touch_uma.cc
+++ b/ash/touch/touch_uma.cc
@@ -44,7 +44,7 @@ enum UMAEventType {
UMA_ET_GESTURE_PINCH_END,
UMA_ET_GESTURE_PINCH_UPDATE,
UMA_ET_GESTURE_LONG_PRESS,
- UMA_ET_GESTURE_MULTIFINGER_SWIPE,
+ UMA_ET_GESTURE_MULTIFINGER_SWIPE_2,
sky 2014/05/27 17:27:54 Document what this and swipe 1 is.
sky 2014/05/27 17:27:54 Can you move all the UMA_ET_GESTURE_MULTIFINGER_SW
Alexei Svitkine (slow) 2014/05/27 17:29:12 If this is used in UMA enum histograms (which it l
sky 2014/05/27 17:36:33 Bummer. If that is the case we should have that wa
mfomitchev 2014/05/27 18:33:43 Done.
mfomitchev 2014/05/27 18:33:43 Done.
UMA_ET_SCROLL,
UMA_ET_SCROLL_FLING_START,
UMA_ET_SCROLL_FLING_CANCEL,
@@ -59,6 +59,7 @@ enum UMAEventType {
UMA_ET_GESTURE_SHOW_PRESS,
UMA_ET_GESTURE_TAP_CANCEL,
UMA_ET_GESTURE_WIN8_EDGE_SWIPE,
+ UMA_ET_GESTURE_MULTIFINGER_SWIPE_1,
// NOTE: Add new event types only immediately above this line. Make sure to
// update the UIEventType enum in tools/metrics/histograms/histograms.xml
// accordingly.
@@ -113,13 +114,13 @@ UMAEventType UMAEventTypeFromEvent(const ui::Event& event) {
case ui::ET_GESTURE_SCROLL_UPDATE: {
const ui::GestureEvent& gesture =
static_cast<const ui::GestureEvent&>(event);
- if (gesture.details().touch_points() >= 4)
- return UMA_ET_GESTURE_SCROLL_UPDATE_4P;
- else if (gesture.details().touch_points() == 3)
- return UMA_ET_GESTURE_SCROLL_UPDATE_3;
+ if (gesture.details().touch_points() == 1)
+ return UMA_ET_GESTURE_SCROLL_UPDATE;
else if (gesture.details().touch_points() == 2)
return UMA_ET_GESTURE_SCROLL_UPDATE_2;
- return UMA_ET_GESTURE_SCROLL_UPDATE;
+ else if (gesture.details().touch_points() == 3)
+ return UMA_ET_GESTURE_SCROLL_UPDATE_3;
+ return UMA_ET_GESTURE_SCROLL_UPDATE_4P;
tdresser 2014/05/27 12:07:31 Thanks for catching this case - I think this does
}
case ui::ET_GESTURE_TAP: {
const ui::GestureEvent& gesture =
@@ -159,14 +160,16 @@ UMAEventType UMAEventTypeFromEvent(const ui::Event& event) {
return UMA_ET_GESTURE_LONG_PRESS;
case ui::ET_GESTURE_LONG_TAP:
return UMA_ET_GESTURE_LONG_TAP;
- case ui::ET_GESTURE_MULTIFINGER_SWIPE: {
+ case ui::ET_GESTURE_SWIPE: {
const ui::GestureEvent& gesture =
static_cast<const ui::GestureEvent&>(event);
- if (gesture.details().touch_points() >= 4)
- return UMA_ET_GESTURE_MULTIFINGER_SWIPE_4P;
+ if (gesture.details().touch_points() == 1)
+ return UMA_ET_GESTURE_MULTIFINGER_SWIPE_1;
+ else if (gesture.details().touch_points() == 2)
+ return UMA_ET_GESTURE_MULTIFINGER_SWIPE_2;
else if (gesture.details().touch_points() == 3)
return UMA_ET_GESTURE_MULTIFINGER_SWIPE_3;
- return UMA_ET_GESTURE_MULTIFINGER_SWIPE;
+ return UMA_ET_GESTURE_MULTIFINGER_SWIPE_4P;
}
case ui::ET_GESTURE_WIN8_EDGE_SWIPE:
return UMA_ET_GESTURE_WIN8_EDGE_SWIPE;
« no previous file with comments | « no previous file | ash/wm/gestures/overview_gesture_handler.cc » ('j') | ash/wm/toplevel_window_event_handler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698