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

Unified Diff: ash/touch/touch_uma.cc

Issue 501553004: Move gesture/touch UMA logs into gesture provider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: format Created 6 years, 4 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 | ui/events/BUILD.gn » ('j') | ui/events/gesture_detection/gesture_provider.h » ('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 b0d093275e41f90eeea7c88b68763a63938cf4ae..9af5882d3a22929cfd223878bc71f85004d1c01e 100644
--- a/ash/touch/touch_uma.cc
+++ b/ash/touch/touch_uma.cc
@@ -23,51 +23,6 @@
namespace {
-enum UMAEventType {
- // WARNING: Do not change the numerical values of any of these types.
- // Do not remove deprecated types - just comment them as deprecated.
- UMA_ET_UNKNOWN = 0,
- UMA_ET_TOUCH_RELEASED = 1,
- UMA_ET_TOUCH_PRESSED = 2,
- UMA_ET_TOUCH_MOVED = 3,
- UMA_ET_TOUCH_STATIONARY = 4, // Deprecated. Do not remove.
- UMA_ET_TOUCH_CANCELLED = 5,
- UMA_ET_GESTURE_SCROLL_BEGIN = 6,
- UMA_ET_GESTURE_SCROLL_END = 7,
- UMA_ET_GESTURE_SCROLL_UPDATE = 8,
- UMA_ET_GESTURE_TAP = 9,
- UMA_ET_GESTURE_TAP_DOWN = 10,
- UMA_ET_GESTURE_BEGIN = 11,
- UMA_ET_GESTURE_END = 12,
- UMA_ET_GESTURE_DOUBLE_TAP = 13,
- UMA_ET_GESTURE_TRIPLE_TAP = 14,
- UMA_ET_GESTURE_TWO_FINGER_TAP = 15,
- UMA_ET_GESTURE_PINCH_BEGIN = 16,
- UMA_ET_GESTURE_PINCH_END = 17,
- UMA_ET_GESTURE_PINCH_UPDATE = 18,
- UMA_ET_GESTURE_LONG_PRESS = 19,
- UMA_ET_GESTURE_SWIPE_2 = 20, // Swipe with 2 fingers
- UMA_ET_SCROLL = 21,
- UMA_ET_SCROLL_FLING_START = 22,
- UMA_ET_SCROLL_FLING_CANCEL = 23,
- UMA_ET_GESTURE_SWIPE_3 = 24, // Swipe with 3 fingers
- UMA_ET_GESTURE_SWIPE_4P = 25, // Swipe with 4+ fingers
- UMA_ET_GESTURE_SCROLL_UPDATE_2 = 26,
- UMA_ET_GESTURE_SCROLL_UPDATE_3 = 27,
- UMA_ET_GESTURE_SCROLL_UPDATE_4P = 28,
- UMA_ET_GESTURE_PINCH_UPDATE_3 = 29,
- UMA_ET_GESTURE_PINCH_UPDATE_4P = 30,
- UMA_ET_GESTURE_LONG_TAP = 31,
- UMA_ET_GESTURE_SHOW_PRESS = 32,
- UMA_ET_GESTURE_TAP_CANCEL = 33,
- UMA_ET_GESTURE_WIN8_EDGE_SWIPE = 34,
- UMA_ET_GESTURE_SWIPE_1 = 35, // Swipe with 1 finger
- // NOTE: Add new event types only immediately above this line. Make sure to
- // update the UIEventType enum in tools/metrics/histograms/histograms.xml
- // accordingly.
- UMA_ET_COUNT
-};
-
struct WindowTouchDetails {
WindowTouchDetails()
: max_distance_from_start_squared_(0) {
tdresser 2014/08/27 12:35:38 You should be able to get rid of max_distance_from
lanwei 2014/08/27 23:31:59 Done.
@@ -97,100 +52,6 @@ struct WindowTouchDetails {
DEFINE_OWNED_WINDOW_PROPERTY_KEY(WindowTouchDetails,
kWindowTouchDetails,
NULL);
-
-
-UMAEventType UMAEventTypeFromEvent(const ui::Event& event) {
- switch (event.type()) {
- case ui::ET_TOUCH_RELEASED:
- return UMA_ET_TOUCH_RELEASED;
- case ui::ET_TOUCH_PRESSED:
- return UMA_ET_TOUCH_PRESSED;
- case ui::ET_TOUCH_MOVED:
- return UMA_ET_TOUCH_MOVED;
- case ui::ET_TOUCH_CANCELLED:
- return UMA_ET_TOUCH_CANCELLED;
- case ui::ET_GESTURE_SCROLL_BEGIN:
- return UMA_ET_GESTURE_SCROLL_BEGIN;
- case ui::ET_GESTURE_SCROLL_END:
- return UMA_ET_GESTURE_SCROLL_END;
- case ui::ET_GESTURE_SCROLL_UPDATE: {
- const ui::GestureEvent& gesture =
- static_cast<const ui::GestureEvent&>(event);
- 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;
- else if (gesture.details().touch_points() == 3)
- return UMA_ET_GESTURE_SCROLL_UPDATE_3;
- return UMA_ET_GESTURE_SCROLL_UPDATE_4P;
- }
- case ui::ET_GESTURE_TAP: {
- const ui::GestureEvent& gesture =
- static_cast<const ui::GestureEvent&>(event);
- int tap_count = gesture.details().tap_count();
- if (tap_count == 1)
- return UMA_ET_GESTURE_TAP;
- if (tap_count == 2)
- return UMA_ET_GESTURE_DOUBLE_TAP;
- if (tap_count == 3)
- return UMA_ET_GESTURE_TRIPLE_TAP;
- NOTREACHED() << "Received tap with tapcount " << tap_count;
- return UMA_ET_UNKNOWN;
- }
- case ui::ET_GESTURE_TAP_DOWN:
- return UMA_ET_GESTURE_TAP_DOWN;
- case ui::ET_GESTURE_BEGIN:
- return UMA_ET_GESTURE_BEGIN;
- case ui::ET_GESTURE_END:
- return UMA_ET_GESTURE_END;
- case ui::ET_GESTURE_TWO_FINGER_TAP:
- return UMA_ET_GESTURE_TWO_FINGER_TAP;
- case ui::ET_GESTURE_PINCH_BEGIN:
- return UMA_ET_GESTURE_PINCH_BEGIN;
- case ui::ET_GESTURE_PINCH_END:
- return UMA_ET_GESTURE_PINCH_END;
- case ui::ET_GESTURE_PINCH_UPDATE: {
- const ui::GestureEvent& gesture =
- static_cast<const ui::GestureEvent&>(event);
- if (gesture.details().touch_points() >= 4)
- return UMA_ET_GESTURE_PINCH_UPDATE_4P;
- else if (gesture.details().touch_points() == 3)
- return UMA_ET_GESTURE_PINCH_UPDATE_3;
- return UMA_ET_GESTURE_PINCH_UPDATE;
- }
- case ui::ET_GESTURE_LONG_PRESS:
- return UMA_ET_GESTURE_LONG_PRESS;
- case ui::ET_GESTURE_LONG_TAP:
- return UMA_ET_GESTURE_LONG_TAP;
- case ui::ET_GESTURE_SWIPE: {
- const ui::GestureEvent& gesture =
- static_cast<const ui::GestureEvent&>(event);
- if (gesture.details().touch_points() == 1)
- return UMA_ET_GESTURE_SWIPE_1;
- else if (gesture.details().touch_points() == 2)
- return UMA_ET_GESTURE_SWIPE_2;
- else if (gesture.details().touch_points() == 3)
- return UMA_ET_GESTURE_SWIPE_3;
- return UMA_ET_GESTURE_SWIPE_4P;
- }
- case ui::ET_GESTURE_WIN8_EDGE_SWIPE:
- return UMA_ET_GESTURE_WIN8_EDGE_SWIPE;
- case ui::ET_GESTURE_TAP_CANCEL:
- return UMA_ET_GESTURE_TAP_CANCEL;
- case ui::ET_GESTURE_SHOW_PRESS:
- return UMA_ET_GESTURE_SHOW_PRESS;
- case ui::ET_SCROLL:
- return UMA_ET_SCROLL;
- case ui::ET_SCROLL_FLING_START:
- return UMA_ET_SCROLL_FLING_START;
- case ui::ET_SCROLL_FLING_CANCEL:
- return UMA_ET_SCROLL_FLING_CANCEL;
- default:
- NOTREACHED();
- return UMA_ET_UNKNOWN;
- }
-}
-
}
namespace ash {
@@ -202,10 +63,6 @@ TouchUMA* TouchUMA::GetInstance() {
void TouchUMA::RecordGestureEvent(aura::Window* target,
const ui::GestureEvent& event) {
- UMA_HISTOGRAM_ENUMERATION("Ash.GestureCreated",
- UMAEventTypeFromEvent(event),
- UMA_ET_COUNT);
-
GestureActionType action = FindGestureActionType(target, event);
RecordGestureAction(action);
@@ -313,17 +170,9 @@ void TouchUMA::RecordTouchEvent(aura::Window* target,
details->last_start_time_.size(),
1, kMaxTouchPoints, kMaxTouchPoints + 1);
} else if (event.type() == ui::ET_TOUCH_RELEASED) {
- if (is_single_finger_gesture_) {
- UMA_HISTOGRAM_CUSTOM_COUNTS("Ash.TouchMaxDistance",
- static_cast<int>(
- sqrt(details->max_distance_from_start_squared_)), 0, 1500, 50);
- }
-
if (details->last_start_time_.count(event.touch_id())) {
base::TimeDelta duration = event.time_stamp() -
details->last_start_time_[event.touch_id()];
- UMA_HISTOGRAM_TIMES("Ash.TouchDuration2", duration);
-
// Look for touches that were [almost] stationary for a long time.
const double kLongStationaryTouchDuration = 10;
const int kLongStationaryTouchDistanceSquared = 100;
« no previous file with comments | « no previous file | ui/events/BUILD.gn » ('j') | ui/events/gesture_detection/gesture_provider.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698