| 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/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 GESTURE_MAXIMIZE_DOUBLETAP, | 47 GESTURE_MAXIMIZE_DOUBLETAP, |
| 48 // NOTE: Add new action types only immediately above this line. Also, | 48 // NOTE: Add new action types only immediately above this line. Also, |
| 49 // make sure the enum list in tools/histogram/histograms.xml is | 49 // make sure the enum list in tools/histogram/histograms.xml is |
| 50 // updated with any change in here. | 50 // updated with any change in here. |
| 51 GESTURE_ACTION_COUNT | 51 GESTURE_ACTION_COUNT |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 // Returns the singleton instance. | 54 // Returns the singleton instance. |
| 55 static TouchUMA* GetInstance(); | 55 static TouchUMA* GetInstance(); |
| 56 | 56 |
| 57 void RecordGestureEvent(aura::Window* target, | 57 void RecordGestureEvent(aura::Window* target, const ui::GestureEvent& event); |
| 58 const ui::GestureEvent& event); | |
| 59 void RecordGestureAction(GestureActionType action); | 58 void RecordGestureAction(GestureActionType action); |
| 60 void RecordTouchEvent(aura::Window* target, | 59 void RecordTouchEvent(aura::Window* target, const ui::TouchEvent& event); |
| 61 const ui::TouchEvent& event); | |
| 62 | 60 |
| 63 private: | 61 private: |
| 64 friend struct base::DefaultSingletonTraits<TouchUMA>; | 62 friend struct base::DefaultSingletonTraits<TouchUMA>; |
| 65 | 63 |
| 66 TouchUMA(); | 64 TouchUMA(); |
| 67 ~TouchUMA(); | 65 ~TouchUMA(); |
| 68 | 66 |
| 69 void UpdateTouchState(const ui::TouchEvent& event); | 67 void UpdateTouchState(const ui::TouchEvent& event); |
| 70 GestureActionType FindGestureActionType(aura::Window* window, | 68 GestureActionType FindGestureActionType(aura::Window* window, |
| 71 const ui::GestureEvent& event); | 69 const ui::GestureEvent& event); |
| 72 | 70 |
| 73 bool is_single_finger_gesture_; | 71 bool is_single_finger_gesture_; |
| 74 // These are used to measure the number of touch-start events we receive in a | 72 // These are used to measure the number of touch-start events we receive in a |
| 75 // quick succession, regardless of the target window. | 73 // quick succession, regardless of the target window. |
| 76 bool touch_in_progress_; | 74 bool touch_in_progress_; |
| 77 int burst_length_; | 75 int burst_length_; |
| 78 base::TimeTicks last_touch_down_time_; | 76 base::TimeTicks last_touch_down_time_; |
| 79 | 77 |
| 80 DISALLOW_COPY_AND_ASSIGN(TouchUMA); | 78 DISALLOW_COPY_AND_ASSIGN(TouchUMA); |
| 81 }; | 79 }; |
| 82 | 80 |
| 83 } // namespace ash | 81 } // namespace ash |
| 84 | 82 |
| 85 #endif // ASH_TOUCH_TOUCH_OBSERVER_UMA_H_ | 83 #endif // ASH_TOUCH_TOUCH_OBSERVER_UMA_H_ |
| OLD | NEW |