| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 kWindowTouchDetails, | 45 kWindowTouchDetails, |
| 46 NULL); | 46 NULL); |
| 47 } | 47 } |
| 48 | 48 |
| 49 DECLARE_WINDOW_PROPERTY_TYPE(WindowTouchDetails*); | 49 DECLARE_WINDOW_PROPERTY_TYPE(WindowTouchDetails*); |
| 50 | 50 |
| 51 namespace ash { | 51 namespace ash { |
| 52 | 52 |
| 53 // static | 53 // static |
| 54 TouchUMA* TouchUMA::GetInstance() { | 54 TouchUMA* TouchUMA::GetInstance() { |
| 55 return Singleton<TouchUMA>::get(); | 55 return base::Singleton<TouchUMA>::get(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void TouchUMA::RecordGestureEvent(aura::Window* target, | 58 void TouchUMA::RecordGestureEvent(aura::Window* target, |
| 59 const ui::GestureEvent& event) { | 59 const ui::GestureEvent& event) { |
| 60 GestureActionType action = FindGestureActionType(target, event); | 60 GestureActionType action = FindGestureActionType(target, event); |
| 61 RecordGestureAction(action); | 61 RecordGestureAction(action); |
| 62 | 62 |
| 63 if (event.type() == ui::ET_GESTURE_END && | 63 if (event.type() == ui::ET_GESTURE_END && |
| 64 event.details().touch_points() == 2) { | 64 event.details().touch_points() == 2) { |
| 65 WindowTouchDetails* details = target->GetProperty(kWindowTouchDetails); | 65 WindowTouchDetails* details = target->GetProperty(kWindowTouchDetails); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 return GESTURE_OMNIBOX_SCROLL; | 299 return GESTURE_OMNIBOX_SCROLL; |
| 300 if (event.type() == ui::ET_GESTURE_PINCH_BEGIN) | 300 if (event.type() == ui::ET_GESTURE_PINCH_BEGIN) |
| 301 return GESTURE_OMNIBOX_PINCH; | 301 return GESTURE_OMNIBOX_PINCH; |
| 302 return GESTURE_UNKNOWN; | 302 return GESTURE_UNKNOWN; |
| 303 } | 303 } |
| 304 | 304 |
| 305 return GESTURE_UNKNOWN; | 305 return GESTURE_UNKNOWN; |
| 306 } | 306 } |
| 307 | 307 |
| 308 } // namespace ash | 308 } // namespace ash |
| OLD | NEW |