OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/touch/touch_uma.h" | 5 #include "ash/touch/touch_uma.h" |
6 | 6 |
7 #include "ash/shell_delegate.h" | |
7 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
8 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
9 #include "ui/aura/event.h" | 10 #include "ui/aura/event.h" |
10 #include "ui/aura/root_window.h" | 11 #include "ui/aura/root_window.h" |
11 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
12 | 13 |
13 namespace { | 14 namespace { |
14 | 15 |
15 enum GestureActionType { | 16 enum GestureActionType { |
16 GESTURE_UNKNOWN, | 17 GESTURE_UNKNOWN, |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
217 GestureActionType action = FindGestureActionType(target, event); | 218 GestureActionType action = FindGestureActionType(target, event); |
218 if (action != GESTURE_UNKNOWN) { | 219 if (action != GESTURE_UNKNOWN) { |
219 UMA_HISTOGRAM_ENUMERATION("Ash.GestureTarget", | 220 UMA_HISTOGRAM_ENUMERATION("Ash.GestureTarget", |
220 action, | 221 action, |
221 GESTURE_ACTION_COUNT); | 222 GESTURE_ACTION_COUNT); |
222 } | 223 } |
223 } | 224 } |
224 | 225 |
225 void TouchUMA::RecordTouchEvent(aura::Window* target, | 226 void TouchUMA::RecordTouchEvent(aura::Window* target, |
226 const aura::TouchEvent& event) { | 227 const aura::TouchEvent& event) { |
227 // TODO(sad|rjkroege): Figure out what to do (heat map?). | 228 if (event.type() == ui::ET_TOUCH_PRESSED) { |
229 Shell::GetInstance()->delegate()->RecordUserMetricsAction( | |
230 UMA_TOUCHSCREEN_TAP_DOWN); | |
231 } | |
232 | |
233 UMA_HISTOGRAM_CUSTOM_COUNTS("Ash.TouchRadius", | |
234 static_cast<int>(std::max(event.radius_x(), event.radius_y())), | |
235 1, 500, 100); | |
Rick Byers
2012/07/31 20:37:36
This seems reasonable to me. We've seen radii > 5
| |
228 } | 236 } |
229 | 237 |
230 } // namespace internal | 238 } // namespace internal |
231 } // namespace ash | 239 } // namespace ash |
OLD | NEW |