| 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/metrics/user_metrics_recorder.h" | 7 #include "ash/metrics/user_metrics_recorder.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 UMA_ET_GESTURE_MULTIFINGER_SWIPE_3, | 51 UMA_ET_GESTURE_MULTIFINGER_SWIPE_3, |
| 52 UMA_ET_GESTURE_MULTIFINGER_SWIPE_4P, // 4+ fingers | 52 UMA_ET_GESTURE_MULTIFINGER_SWIPE_4P, // 4+ fingers |
| 53 UMA_ET_GESTURE_SCROLL_UPDATE_2, | 53 UMA_ET_GESTURE_SCROLL_UPDATE_2, |
| 54 UMA_ET_GESTURE_SCROLL_UPDATE_3, | 54 UMA_ET_GESTURE_SCROLL_UPDATE_3, |
| 55 UMA_ET_GESTURE_SCROLL_UPDATE_4P, | 55 UMA_ET_GESTURE_SCROLL_UPDATE_4P, |
| 56 UMA_ET_GESTURE_PINCH_UPDATE_3, | 56 UMA_ET_GESTURE_PINCH_UPDATE_3, |
| 57 UMA_ET_GESTURE_PINCH_UPDATE_4P, | 57 UMA_ET_GESTURE_PINCH_UPDATE_4P, |
| 58 UMA_ET_GESTURE_LONG_TAP, | 58 UMA_ET_GESTURE_LONG_TAP, |
| 59 UMA_ET_GESTURE_SHOW_PRESS, | 59 UMA_ET_GESTURE_SHOW_PRESS, |
| 60 UMA_ET_GESTURE_TAP_CANCEL, | 60 UMA_ET_GESTURE_TAP_CANCEL, |
| 61 UMA_ET_GESTURE_WIN8_EDGE_SWIPE, |
| 61 // NOTE: Add new event types only immediately above this line. Make sure to | 62 // NOTE: Add new event types only immediately above this line. Make sure to |
| 62 // update the enum list in tools/metrics/histogram/histograms.xml accordingly. | 63 // update the UIEventType enum in tools/metrics/histograms/histograms.xml |
| 64 // accordingly. |
| 63 UMA_ET_COUNT | 65 UMA_ET_COUNT |
| 64 }; | 66 }; |
| 65 | 67 |
| 66 struct WindowTouchDetails { | 68 struct WindowTouchDetails { |
| 67 WindowTouchDetails() | 69 WindowTouchDetails() |
| 68 : max_distance_from_start_squared_(0) { | 70 : max_distance_from_start_squared_(0) { |
| 69 } | 71 } |
| 70 | 72 |
| 71 // Move and start times of the touch points. The key is the touch-id. | 73 // Move and start times of the touch points. The key is the touch-id. |
| 72 std::map<int, base::TimeDelta> last_move_time_; | 74 std::map<int, base::TimeDelta> last_move_time_; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 return UMA_ET_GESTURE_LONG_TAP; | 163 return UMA_ET_GESTURE_LONG_TAP; |
| 162 case ui::ET_GESTURE_MULTIFINGER_SWIPE: { | 164 case ui::ET_GESTURE_MULTIFINGER_SWIPE: { |
| 163 const ui::GestureEvent& gesture = | 165 const ui::GestureEvent& gesture = |
| 164 static_cast<const ui::GestureEvent&>(event); | 166 static_cast<const ui::GestureEvent&>(event); |
| 165 if (gesture.details().touch_points() >= 4) | 167 if (gesture.details().touch_points() >= 4) |
| 166 return UMA_ET_GESTURE_MULTIFINGER_SWIPE_4P; | 168 return UMA_ET_GESTURE_MULTIFINGER_SWIPE_4P; |
| 167 else if (gesture.details().touch_points() == 3) | 169 else if (gesture.details().touch_points() == 3) |
| 168 return UMA_ET_GESTURE_MULTIFINGER_SWIPE_3; | 170 return UMA_ET_GESTURE_MULTIFINGER_SWIPE_3; |
| 169 return UMA_ET_GESTURE_MULTIFINGER_SWIPE; | 171 return UMA_ET_GESTURE_MULTIFINGER_SWIPE; |
| 170 } | 172 } |
| 173 case ui::ET_GESTURE_WIN8_EDGE_SWIPE: |
| 174 return UMA_ET_GESTURE_WIN8_EDGE_SWIPE; |
| 171 case ui::ET_GESTURE_TAP_CANCEL: | 175 case ui::ET_GESTURE_TAP_CANCEL: |
| 172 return UMA_ET_GESTURE_TAP_CANCEL; | 176 return UMA_ET_GESTURE_TAP_CANCEL; |
| 173 case ui::ET_GESTURE_SHOW_PRESS: | 177 case ui::ET_GESTURE_SHOW_PRESS: |
| 174 return UMA_ET_GESTURE_SHOW_PRESS; | 178 return UMA_ET_GESTURE_SHOW_PRESS; |
| 175 case ui::ET_SCROLL: | 179 case ui::ET_SCROLL: |
| 176 return UMA_ET_SCROLL; | 180 return UMA_ET_SCROLL; |
| 177 case ui::ET_SCROLL_FLING_START: | 181 case ui::ET_SCROLL_FLING_START: |
| 178 return UMA_ET_SCROLL_FLING_START; | 182 return UMA_ET_SCROLL_FLING_START; |
| 179 case ui::ET_SCROLL_FLING_CANCEL: | 183 case ui::ET_SCROLL_FLING_CANCEL: |
| 180 return UMA_ET_SCROLL_FLING_CANCEL; | 184 return UMA_ET_SCROLL_FLING_CANCEL; |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 return GESTURE_OMNIBOX_SCROLL; | 464 return GESTURE_OMNIBOX_SCROLL; |
| 461 if (event.type() == ui::ET_GESTURE_PINCH_BEGIN) | 465 if (event.type() == ui::ET_GESTURE_PINCH_BEGIN) |
| 462 return GESTURE_OMNIBOX_PINCH; | 466 return GESTURE_OMNIBOX_PINCH; |
| 463 return GESTURE_UNKNOWN; | 467 return GESTURE_UNKNOWN; |
| 464 } | 468 } |
| 465 | 469 |
| 466 return GESTURE_UNKNOWN; | 470 return GESTURE_UNKNOWN; |
| 467 } | 471 } |
| 468 | 472 |
| 469 } // namespace ash | 473 } // namespace ash |
| OLD | NEW |