Chromium Code Reviews| Index: ash/touch/touch_uma.cc |
| diff --git a/ash/touch/touch_uma.cc b/ash/touch/touch_uma.cc |
| index ca2a8263baff687c3171970288bd5143ec0105b5..565abe9a300a2044230121fdc8f759a5de2d9808 100644 |
| --- a/ash/touch/touch_uma.cc |
| +++ b/ash/touch/touch_uma.cc |
| @@ -267,6 +267,20 @@ void TouchUMA::RecordTouchEvent(aura::Window* target, |
| target->SetProperty(kWindowTouchDetails, details); |
| } |
| + // Record the location of the touch points. |
| + const int kBucketCount = 100; |
| + const gfx::Rect bounds = target->GetRootWindow()->bounds(); |
| + const int kBucketSizeX = bounds.width() / kBucketCount; |
| + const int kBucketSizeY = bounds.height() / kBucketCount; |
| + STATIC_HISTOGRAM_POINTER_BLOCK("Ash.TouchPositionX", |
|
Rick Byers
2012/08/10 18:07:09
Too bad there's not a linear version of UMA_HISTOG
|
| + Add(event.root_location().x() / kBucketSizeX), |
| + base::LinearHistogram::FactoryGet("Ash.TouchPositionX", 1, kBucketCount, |
| + kBucketCount + 1, base::Histogram::kUmaTargetedHistogramFlag)); |
| + STATIC_HISTOGRAM_POINTER_BLOCK("Ash.TouchPositionY", |
| + Add(event.root_location().y() / kBucketSizeY), |
| + base::LinearHistogram::FactoryGet("Ash.TouchPositionY", 1, kBucketCount, |
| + kBucketCount + 1, base::Histogram::kUmaTargetedHistogramFlag)); |
| + |
| if (event.type() == ui::ET_TOUCH_PRESSED) { |
| Shell::GetInstance()->delegate()->RecordUserMetricsAction( |
| UMA_TOUCHSCREEN_TAP_DOWN); |
| @@ -286,6 +300,13 @@ void TouchUMA::RecordTouchEvent(aura::Window* target, |
| gap.InMilliseconds()); |
| } |
| } |
| + |
| + // 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), |
| + 1, kMaxTouchPoints, kMaxTouchPoints); |
|
sadrul
2012/08/10 15:54:43
This will effectively be linear, right?
|
| } else if (event.type() == ui::ET_TOUCH_RELEASED) { |
| if (details->last_start_time_.count(event.touch_id())) { |
| base::TimeDelta duration = event.time_stamp() - |