Chromium Code Reviews| Index: ash/touch/touch_uma.cc |
| diff --git a/ash/touch/touch_uma.cc b/ash/touch/touch_uma.cc |
| index 729a6e4e6f8d487c29da77ec0832508816db217f..c97a56c93e5affc8c463663aa0d1c5a8630d1200 100644 |
| --- a/ash/touch/touch_uma.cc |
| +++ b/ash/touch/touch_uma.cc |
| @@ -30,6 +30,9 @@ enum GestureActionType { |
| GESTURE_DESKTOP_PINCH, |
| GESTURE_WEBPAGE_PINCH, |
| GESTURE_WEBPAGE_SCROLL, |
| + GESTURE_WEBPAGE_TAP, |
| + GESTURE_TABSTRIP_TAP, |
| + GESTURE_BEZEL_TAP, |
| // NOTE: Add new action types only immediately above this line. Also, make sure |
| // the enum list in tools/histogram/histograms.xml is updated with any change in |
| // here. |
| @@ -98,6 +101,8 @@ GestureActionType FindGestureActionType(aura::Window* window, |
| if (!window || window->GetRootWindow() == window) { |
| if (event.type() == ui::ET_GESTURE_SCROLL_BEGIN) |
| return GESTURE_BEZEL_SCROLL; |
| + if (event.type() == ui::ET_GESTURE_TAP) |
| + return GESTURE_BEZEL_TAP; |
|
sadrul
2012/08/14 05:21:05
rbyers@: Do you think counting long-press here wou
Rick Byers
2012/08/14 05:30:41
Couldn't hurt, but I'm not sure it adds that much
|
| return GESTURE_UNKNOWN; |
| } |
| @@ -118,6 +123,8 @@ GestureActionType FindGestureActionType(aura::Window* window, |
| return GESTURE_WEBPAGE_PINCH; |
| if (event.type() == ui::ET_GESTURE_SCROLL_BEGIN) |
| return GESTURE_WEBPAGE_SCROLL; |
| + if (event.type() == ui::ET_GESTURE_TAP) |
| + return GESTURE_WEBPAGE_TAP; |
| return GESTURE_UNKNOWN; |
| } |
| @@ -139,6 +146,8 @@ GestureActionType FindGestureActionType(aura::Window* window, |
| return GESTURE_TABSTRIP_SCROLL; |
| if (event.type() == ui::ET_GESTURE_PINCH_BEGIN) |
| return GESTURE_TABSTRIP_PINCH; |
| + if (event.type() == ui::ET_GESTURE_TAP) |
| + return GESTURE_TABSTRIP_TAP; |
| return GESTURE_UNKNOWN; |
| } |
| @@ -273,10 +282,10 @@ void TouchUMA::RecordTouchEvent(aura::Window* target, |
| } |
| // Record the location of the touch points. |
| - const int kBucketCount = 100; |
| + const int kBucketCountForLocation = 100; |
| const gfx::Rect bounds = target->GetRootWindow()->bounds(); |
| - const int bucket_size_x = bounds.width() / kBucketCount; |
| - const int bucket_size_y = bounds.height() / kBucketCount; |
| + const int bucket_size_x = bounds.width() / kBucketCountForLocation; |
| + const int bucket_size_y = bounds.height() / kBucketCountForLocation; |
| gfx::Point position = event.root_location(); |
| @@ -306,12 +315,14 @@ void TouchUMA::RecordTouchEvent(aura::Window* target, |
| STATIC_HISTOGRAM_POINTER_BLOCK("Ash.TouchPositionX", |
| Add(position.x() / bucket_size_x), |
| - base::LinearHistogram::FactoryGet("Ash.TouchPositionX", 1, kBucketCount, |
| - kBucketCount + 1, base::Histogram::kUmaTargetedHistogramFlag)); |
| + base::LinearHistogram::FactoryGet("Ash.TouchPositionX", 0, |
| + kBucketCountForLocation, kBucketCountForLocation + 1, |
| + base::Histogram::kUmaTargetedHistogramFlag)); |
| STATIC_HISTOGRAM_POINTER_BLOCK("Ash.TouchPositionY", |
| Add(position.y() / bucket_size_y), |
| - base::LinearHistogram::FactoryGet("Ash.TouchPositionY", 1, kBucketCount, |
| - kBucketCount + 1, base::Histogram::kUmaTargetedHistogramFlag)); |
| + base::LinearHistogram::FactoryGet("Ash.TouchPositionY", 0, |
| + kBucketCountForLocation, kBucketCountForLocation + 1, |
| + base::Histogram::kUmaTargetedHistogramFlag)); |
|
Ilya Sherman
2012/08/14 05:27:38
As I mentioned on the other CL, I don't think that
sadrul
2012/08/14 05:29:56
We expect that a linear histogram would be more us
Rick Byers
2012/08/14 05:30:41
CUSTOM_COUNTS uses an exponential distribution, ri
Ilya Sherman
2012/08/14 05:45:00
If you create a CUSTOM_COUNTS histogram with 101 b
|
| if (event.type() == ui::ET_TOUCH_PRESSED) { |
| Shell::GetInstance()->delegate()->RecordUserMetricsAction( |
| @@ -336,8 +347,7 @@ void TouchUMA::RecordTouchEvent(aura::Window* target, |
| // Record the number of touch-points currently active for the window. |
| const int kMaxTouchPoints = 10; |
| UMA_HISTOGRAM_CUSTOM_COUNTS("Ash.ActiveTouchPoints", |
| - std::min(static_cast<int>(details->last_start_time_.size()), |
| - kMaxTouchPoints), |
| + details->last_start_time_.size(), |
| 1, kMaxTouchPoints, kMaxTouchPoints); |
| } else if (event.type() == ui::ET_TOUCH_RELEASED) { |
| if (details->last_start_time_.count(event.touch_id())) { |