| 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 #ifndef ASH_TOUCH_TOUCH_OBSERVER_UMA_H_ | 5 #ifndef ASH_TOUCH_TOUCH_OBSERVER_UMA_H_ |
| 6 #define ASH_TOUCH_TOUCH_OBSERVER_UMA_H_ | 6 #define ASH_TOUCH_TOUCH_OBSERVER_UMA_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "ash/common/metrics/gesture_action_type.h" |
| 10 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
| 13 #include "ui/gfx/geometry/point.h" | 14 #include "ui/gfx/geometry/point.h" |
| 14 #include "ui/views/widget/widget.h" | 15 #include "ui/views/widget/widget.h" |
| 15 | 16 |
| 16 namespace aura { | 17 namespace aura { |
| 17 class Window; | 18 class Window; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace ash { | 21 namespace ash { |
| 21 | 22 |
| 22 // Records some touch/gesture event specific details (e.g. what gestures are | 23 // Records some touch/gesture event specific details (e.g. what gestures are |
| 23 // targetted to which components etc.) | 24 // targetted to which components etc.) |
| 24 class ASH_EXPORT TouchUMA { | 25 class ASH_EXPORT TouchUMA { |
| 25 public: | 26 public: |
| 26 enum GestureActionType { | |
| 27 GESTURE_UNKNOWN, | |
| 28 GESTURE_OMNIBOX_PINCH, | |
| 29 GESTURE_OMNIBOX_SCROLL, | |
| 30 GESTURE_TABSTRIP_PINCH, | |
| 31 GESTURE_TABSTRIP_SCROLL, | |
| 32 GESTURE_BEZEL_SCROLL, | |
| 33 GESTURE_DESKTOP_SCROLL, | |
| 34 GESTURE_DESKTOP_PINCH, | |
| 35 GESTURE_WEBPAGE_PINCH, | |
| 36 GESTURE_WEBPAGE_SCROLL, | |
| 37 GESTURE_WEBPAGE_TAP, | |
| 38 GESTURE_TABSTRIP_TAP, | |
| 39 GESTURE_BEZEL_DOWN, | |
| 40 GESTURE_TABSWITCH_TAP, | |
| 41 GESTURE_TABNOSWITCH_TAP, | |
| 42 GESTURE_TABCLOSE_TAP, | |
| 43 GESTURE_NEWTAB_TAP, | |
| 44 GESTURE_ROOTVIEWTOP_TAP, | |
| 45 GESTURE_FRAMEMAXIMIZE_TAP, | |
| 46 GESTURE_FRAMEVIEW_TAP, | |
| 47 GESTURE_MAXIMIZE_DOUBLETAP, | |
| 48 // NOTE: Add new action types only immediately above this line. Also, | |
| 49 // make sure the enum list in tools/histogram/histograms.xml is | |
| 50 // updated with any change in here. | |
| 51 GESTURE_ACTION_COUNT | |
| 52 }; | |
| 53 | |
| 54 // Returns the singleton instance. | 27 // Returns the singleton instance. |
| 55 static TouchUMA* GetInstance(); | 28 static TouchUMA* GetInstance(); |
| 56 | 29 |
| 57 void RecordGestureEvent(aura::Window* target, const ui::GestureEvent& event); | 30 void RecordGestureEvent(aura::Window* target, const ui::GestureEvent& event); |
| 58 void RecordGestureAction(GestureActionType action); | 31 void RecordGestureAction(GestureActionType action); |
| 59 void RecordTouchEvent(aura::Window* target, const ui::TouchEvent& event); | 32 void RecordTouchEvent(aura::Window* target, const ui::TouchEvent& event); |
| 60 | 33 |
| 61 private: | 34 private: |
| 62 friend struct base::DefaultSingletonTraits<TouchUMA>; | 35 friend struct base::DefaultSingletonTraits<TouchUMA>; |
| 63 | 36 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 74 bool touch_in_progress_; | 47 bool touch_in_progress_; |
| 75 int burst_length_; | 48 int burst_length_; |
| 76 base::TimeTicks last_touch_down_time_; | 49 base::TimeTicks last_touch_down_time_; |
| 77 | 50 |
| 78 DISALLOW_COPY_AND_ASSIGN(TouchUMA); | 51 DISALLOW_COPY_AND_ASSIGN(TouchUMA); |
| 79 }; | 52 }; |
| 80 | 53 |
| 81 } // namespace ash | 54 } // namespace ash |
| 82 | 55 |
| 83 #endif // ASH_TOUCH_TOUCH_OBSERVER_UMA_H_ | 56 #endif // ASH_TOUCH_TOUCH_OBSERVER_UMA_H_ |
| OLD | NEW |