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

Side by Side Diff: ash/touch/touch_uma.cc

Issue 16018006: Generate tap gesture with tap_count = 3 for triple-tap (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: refator Created 7 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/aura/gestures/gesture_recognizer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ash/shell_delegate.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "ui/aura/env.h" 10 #include "ui/aura/env.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 UMA_ET_TOUCH_STATIONARY, 50 UMA_ET_TOUCH_STATIONARY,
51 UMA_ET_TOUCH_CANCELLED, 51 UMA_ET_TOUCH_CANCELLED,
52 UMA_ET_GESTURE_SCROLL_BEGIN, 52 UMA_ET_GESTURE_SCROLL_BEGIN,
53 UMA_ET_GESTURE_SCROLL_END, 53 UMA_ET_GESTURE_SCROLL_END,
54 UMA_ET_GESTURE_SCROLL_UPDATE, 54 UMA_ET_GESTURE_SCROLL_UPDATE,
55 UMA_ET_GESTURE_TAP, 55 UMA_ET_GESTURE_TAP,
56 UMA_ET_GESTURE_TAP_DOWN, 56 UMA_ET_GESTURE_TAP_DOWN,
57 UMA_ET_GESTURE_BEGIN, 57 UMA_ET_GESTURE_BEGIN,
58 UMA_ET_GESTURE_END, 58 UMA_ET_GESTURE_END,
59 UMA_ET_GESTURE_DOUBLE_TAP, 59 UMA_ET_GESTURE_DOUBLE_TAP,
60 UMA_ET_GESTURE_TRIPLE_TAP,
60 UMA_ET_GESTURE_TWO_FINGER_TAP, 61 UMA_ET_GESTURE_TWO_FINGER_TAP,
61 UMA_ET_GESTURE_PINCH_BEGIN, 62 UMA_ET_GESTURE_PINCH_BEGIN,
62 UMA_ET_GESTURE_PINCH_END, 63 UMA_ET_GESTURE_PINCH_END,
63 UMA_ET_GESTURE_PINCH_UPDATE, 64 UMA_ET_GESTURE_PINCH_UPDATE,
64 UMA_ET_GESTURE_LONG_PRESS, 65 UMA_ET_GESTURE_LONG_PRESS,
65 UMA_ET_GESTURE_MULTIFINGER_SWIPE, 66 UMA_ET_GESTURE_MULTIFINGER_SWIPE,
66 UMA_ET_SCROLL, 67 UMA_ET_SCROLL,
67 UMA_ET_SCROLL_FLING_START, 68 UMA_ET_SCROLL_FLING_START,
68 UMA_ET_SCROLL_FLING_CANCEL, 69 UMA_ET_SCROLL_FLING_CANCEL,
69 UMA_ET_GESTURE_MULTIFINGER_SWIPE_3, 70 UMA_ET_GESTURE_MULTIFINGER_SWIPE_3,
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 else if (gesture.details().touch_points() == 2) 195 else if (gesture.details().touch_points() == 2)
195 return UMA_ET_GESTURE_SCROLL_UPDATE_2; 196 return UMA_ET_GESTURE_SCROLL_UPDATE_2;
196 return UMA_ET_GESTURE_SCROLL_UPDATE; 197 return UMA_ET_GESTURE_SCROLL_UPDATE;
197 } 198 }
198 case ui::ET_GESTURE_TAP: { 199 case ui::ET_GESTURE_TAP: {
199 const ui::GestureEvent& gesture = 200 const ui::GestureEvent& gesture =
200 static_cast<const ui::GestureEvent&>(event); 201 static_cast<const ui::GestureEvent&>(event);
201 int tap_count = gesture.details().tap_count(); 202 int tap_count = gesture.details().tap_count();
202 if (tap_count == 1) 203 if (tap_count == 1)
203 return UMA_ET_GESTURE_TAP; 204 return UMA_ET_GESTURE_TAP;
204 else if (tap_count == 2) 205 else if (tap_count == 2)
sky 2013/05/28 21:08:37 nit: style guide says no else for ifs that return,
205 return UMA_ET_GESTURE_DOUBLE_TAP; 206 return UMA_ET_GESTURE_DOUBLE_TAP;
207 else if (tap_count == 3)
208 return UMA_ET_GESTURE_TRIPLE_TAP;
206 NOTREACHED() << "Received tap with tapcount " << tap_count; 209 NOTREACHED() << "Received tap with tapcount " << tap_count;
207 return UMA_ET_UNKNOWN; 210 return UMA_ET_UNKNOWN;
208 } 211 }
209 case ui::ET_GESTURE_TAP_DOWN: 212 case ui::ET_GESTURE_TAP_DOWN:
210 return UMA_ET_GESTURE_TAP_DOWN; 213 return UMA_ET_GESTURE_TAP_DOWN;
211 case ui::ET_GESTURE_BEGIN: 214 case ui::ET_GESTURE_BEGIN:
212 return UMA_ET_GESTURE_BEGIN; 215 return UMA_ET_GESTURE_BEGIN;
213 case ui::ET_GESTURE_END: 216 case ui::ET_GESTURE_END:
214 return UMA_ET_GESTURE_END; 217 return UMA_ET_GESTURE_END;
215 case ui::ET_GESTURE_TWO_FINGER_TAP: 218 case ui::ET_GESTURE_TWO_FINGER_TAP:
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 touch_in_progress_ = true; 440 touch_in_progress_ = true;
438 last_touch_down_time_ = event.time_stamp(); 441 last_touch_down_time_ = event.time_stamp();
439 } else if (event.type() == ui::ET_TOUCH_RELEASED) { 442 } else if (event.type() == ui::ET_TOUCH_RELEASED) {
440 if (!aura::Env::GetInstance()->is_touch_down()) 443 if (!aura::Env::GetInstance()->is_touch_down())
441 touch_in_progress_ = false; 444 touch_in_progress_ = false;
442 } 445 }
443 } 446 }
444 447
445 } // namespace internal 448 } // namespace internal
446 } // namespace ash 449 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ui/aura/gestures/gesture_recognizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698