| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/events/gesture_detection/gesture_touch_uma_histogram.h" | 5 #include "ui/events/gesture_detection/gesture_touch_uma_histogram.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 | 8 |
| 9 namespace ui { | 9 namespace ui { |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 } else { | 36 } else { |
| 37 if (event.GetAction() == MotionEvent::ACTION_UP && is_single_finger_) { | 37 if (event.GetAction() == MotionEvent::ACTION_UP && is_single_finger_) { |
| 38 UMA_HISTOGRAM_CUSTOM_COUNTS( | 38 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 39 "Event.TouchMaxDistance", | 39 "Event.TouchMaxDistance", |
| 40 static_cast<int>(sqrt(max_distance_from_start_squared_)), | 40 static_cast<int>(sqrt(max_distance_from_start_squared_)), |
| 41 0, | 41 0, |
| 42 1500, | 42 1500, |
| 43 50); | 43 50); |
| 44 | 44 |
| 45 base::TimeDelta duration = event.GetEventTime() - start_time_; | 45 base::TimeDelta duration = event.GetEventTime() - start_time_; |
| 46 UMA_HISTOGRAM_TIMES("Event.TouchDuration2", duration); | 46 UMA_HISTOGRAM_TIMES("Event.TouchDuration", duration); |
| 47 } | 47 } |
| 48 is_single_finger_ = false; | 48 is_single_finger_ = false; |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 | 51 |
| 52 UMAEventType GestureTouchUMAHistogram::UMAEventTypeFromEvent( | 52 UMAEventType GestureTouchUMAHistogram::UMAEventTypeFromEvent( |
| 53 const GestureEventData& gesture) { | 53 const GestureEventData& gesture) { |
| 54 switch (gesture.type()) { | 54 switch (gesture.type()) { |
| 55 case ET_TOUCH_RELEASED: | 55 case ET_TOUCH_RELEASED: |
| 56 return UMA_ET_TOUCH_RELEASED; | 56 return UMA_ET_TOUCH_RELEASED; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 return UMA_ET_GESTURE_TAP_UNCONFIRMED; | 135 return UMA_ET_GESTURE_TAP_UNCONFIRMED; |
| 136 case ET_GESTURE_DOUBLE_TAP: | 136 case ET_GESTURE_DOUBLE_TAP: |
| 137 return UMA_ET_GESTURE_DOUBLE_TAP; | 137 return UMA_ET_GESTURE_DOUBLE_TAP; |
| 138 default: | 138 default: |
| 139 NOTREACHED(); | 139 NOTREACHED(); |
| 140 return UMA_ET_UNKNOWN; | 140 return UMA_ET_UNKNOWN; |
| 141 } | 141 } |
| 142 } | 142 } |
| 143 | 143 |
| 144 } // namespace ui | 144 } // namespace ui |
| OLD | NEW |