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

Unified Diff: ash/touch/touch_uma.cc

Issue 10826247: ash: Add some more touch UMA. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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 | no next file » | no next file with comments »
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 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() -
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698