1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_METRICS_POINTER_METRICS_RECORDER_H_
#define ASH_METRICS_POINTER_METRICS_RECORDER_H_
#include "ash/ash_export.h"
#include "ui/events/event_handler.h"
namespace ash {
// Form factor of the down event.
// This enum is used to control a UMA histogram buckets. If you change this
// enum, you should update DownEventMetric as well.
enum class DownEventFormFactor {
kClamshell = 0,
kTabletModeLandscape,
kTabletModePortrait,
kFormFactorCount,
};
// Input type of the down event.
// This enum is used to control a UMA histogram buckets. If you change this
// enum, you should update DownEventMetric as well.
enum class DownEventSource {
kUnknown = 0, // Deprecated, never occurs in practice.
kMouse,
kStylus,
kTouch,
kSourceCount,
};
// App type (Destination), Input and FormFactor Combination of the down event.
// This enum is used to back an UMA histogram and new values should
// be inserted immediately above kMaxValue.
enum class DownEventMetric2 {
// All "Unknown" types are deprecated, never occur in practice.
kNonAppUnknownClamshell = 0,
kNonAppUnknownTabletLandscape = 1,
kNonAppUnknownTabletPortrait = 2,
kNonAppMouseClamshell = 3,
kNonAppMouseTabletLandscape = 4,
kNonAppMouseTabletPortrait = 5,
kNonAppStylusClamshell = 6,
kNonAppStylusTabletLandscape = 7,
kNonAppStylusTabletPortrait = 8,
kNonAppTouchClamshell = 9,
kNonAppTouchTabletLandscape = 10,
kNonAppTouchTabletPortrait = 11,
kBrowserUnknownClamshell = 12,
kBrowserUnknownTabletLandscape = 13,
kBrowserUnknownTabletPortrait = 14,
kBrowserMouseClamshell = 15,
kBrowserMouseTabletLandscape = 16,
kBrowserMouseTabletPortrait = 17,
kBrowserStylusClamshell = 18,
kBrowserStylusTabletLandscape = 19,
kBrowserStylusTabletPortrait = 20,
kBrowserTouchClamshell = 21,
kBrowserTouchTabletLandscape = 22,
kBrowserTouchTabletPortrait = 23,
kChromeAppUnknownClamshell = 24,
kChromeAppUnknownTabletLandscape = 25,
kChromeAppUnknownTabletPortrait = 26,
kChromeAppMouseClamshell = 27,
kChromeAppMouseTabletLandscape = 28,
kChromeAppMouseTabletPortrait = 29,
kChromeAppStylusClamshell = 30,
kChromeAppStylusTabletLandscape = 31,
kChromeAppStylusTabletPortrait = 32,
kChromeAppTouchClamshell = 33,
kChromeAppTouchTabletLandscape = 34,
kChromeAppTouchTabletPortrait = 35,
kArcAppUnknownClamshell = 36,
kArcAppUnknownTabletLandscape = 37,
kArcAppUnknownTabletPortrait = 38,
kArcAppMouseClamshell = 39,
kArcAppMouseTabletLandscape = 40,
kArcAppMouseTabletPortrait = 41,
kArcAppStylusClamshell = 42,
kArcAppStylusTabletLandscape = 43,
kArcAppStylusTabletPortrait = 44,
kArcAppTouchClamshell = 45,
kArcAppTouchTabletLandscape = 46,
kArcAppTouchTabletPortrait = 47,
kCrostiniAppUnknownClamshell = 48,
kCrostiniAppUnknownTabletLandscape = 49,
kCrostiniAppUnknownTabletPortrait = 50,
kCrostiniAppMouseClamshell = 51,
kCrostiniAppMouseTabletLandscape = 52,
kCrostiniAppMouseTabletPortrait = 53,
kCrostiniAppStylusClamshell = 54,
kCrostiniAppStylusTabletLandscape = 55,
kCrostiniAppStylusTabletPortrait = 56,
kCrostiniAppTouchClamshell = 57,
kCrostiniAppTouchTabletLandscape = 58,
kCrostiniAppTouchTabletPortrait = 59,
kSystemAppUnknownClamshell = 60,
kSystemAppUnknownTabletLandscape = 61,
kSystemAppUnknownTabletPortrait = 62,
kSystemAppMouseClamshell = 63,
kSystemAppMouseTabletLandscape = 64,
kSystemAppMouseTabletPortrait = 65,
kSystemAppStylusClamshell = 66,
kSystemAppStylusTabletLandscape = 67,
kSystemAppStylusTabletPortrait = 68,
kSystemAppTouchClamshell = 69,
kSystemAppTouchTabletLandscape = 70,
kSystemAppTouchTabletPortrait = 71,
kMaxValue = kSystemAppTouchTabletPortrait
};
// A metrics recorder that records pointer related metrics.
class ASH_EXPORT PointerMetricsRecorder : public ui::EventHandler {
public:
PointerMetricsRecorder();
PointerMetricsRecorder(const PointerMetricsRecorder&) = delete;
PointerMetricsRecorder& operator=(const PointerMetricsRecorder&) = delete;
~PointerMetricsRecorder() override;
// ui::EventHandler:
void OnMouseEvent(ui::MouseEvent* event) override;
void OnTouchEvent(ui::TouchEvent* event) override;
};
} // namespace ash
#endif // ASH_METRICS_POINTER_METRICS_RECORDER_H_
|