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

Unified Diff: ash/touch/touch_uma.h

Issue 16832003: Add UMA metrics to measure the effectiveness of views fuzzing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/touch/touch_uma.cc » ('j') | ash/touch/touch_uma.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/touch/touch_uma.h
diff --git a/ash/touch/touch_uma.h b/ash/touch/touch_uma.h
index 46805b10fa0f33dee7bff1a191282936d06df0b0..1a36897375953453345bd9f490def7ec99b3c923 100644
--- a/ash/touch/touch_uma.h
+++ b/ash/touch/touch_uma.h
@@ -8,6 +8,7 @@
#include <map>
#include "ash/shell.h"
+#include "base/memory/singleton.h"
#include "ui/gfx/point.h"
#include "ui/views/widget/widget.h"
@@ -20,18 +21,54 @@ namespace internal {
// Records some touch/gesture event specific details (e.g. what gestures are
// targetted to which components etc.)
-class TouchUMA {
+class ASH_EXPORT TouchUMA {
public:
- TouchUMA();
- ~TouchUMA();
+ enum GestureActionType {
+ GESTURE_UNKNOWN,
+ GESTURE_OMNIBOX_PINCH,
+ GESTURE_OMNIBOX_SCROLL,
+ GESTURE_TABSTRIP_PINCH,
+ GESTURE_TABSTRIP_SCROLL,
+ GESTURE_BEZEL_SCROLL,
+ GESTURE_DESKTOP_SCROLL,
+ GESTURE_DESKTOP_PINCH,
+ GESTURE_WEBPAGE_PINCH,
+ GESTURE_WEBPAGE_SCROLL,
+ GESTURE_WEBPAGE_TAP,
+ GESTURE_TABSTRIP_TAP,
+ GESTURE_BEZEL_DOWN,
+ GESTURE_TABSWITCH_TAP,
+ GESTURE_TABNOSWITCH_TAP,
+ GESTURE_TABCLOSE_TAP,
+ GESTURE_NEWTAB_TAP,
+ GESTURE_FRAMEMAXIMIZE_TAP,
+ GESTURE_FRAMEVIEW_TAP,
+ GESTURE_ROOTVIEWTOP_TAP,
+ GESTURE_MAXIMIZE_DOUBLETAP,
+ // NOTE: Add new action types only immediately above this line. Also,
+ // make sure the enum list in tools/histogram/histograms.xml is
+ // updated with any change in here.
+ GESTURE_ACTION_COUNT
+ };
+
+ // Returns the singleton instance.
+ static TouchUMA* GetInstance();
void RecordGestureEvent(aura::Window* target,
const ui::GestureEvent& event);
+ void RecordGestureAction(GestureActionType action);
void RecordTouchEvent(aura::Window* target,
const ui::TouchEvent& event);
private:
+ friend struct DefaultSingletonTraits<TouchUMA>;
+
+ TouchUMA();
+ ~TouchUMA();
+
void UpdateBurstData(const ui::TouchEvent& event);
+ GestureActionType FindGestureActionType(aura::Window* window,
+ const ui::GestureEvent& event);
// These are used to measure the number of touch-start events we receive in a
// quick succession, regardless of the target window.
« no previous file with comments | « no previous file | ash/touch/touch_uma.cc » ('j') | ash/touch/touch_uma.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698