1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_DEVICE_UMA_H_
6 #define CHROME_BROWSER_CHROMEOS_DEVICE_UMA_H_
8 #include "base/basictypes.h"
9 #include "ui/events/platform/platform_event_observer.h"
12 template <typename T
> struct DefaultSingletonTraits
;
17 // A class to record devices' input event details via the UMA system
18 class DeviceUMA
: public ui::PlatformEventObserver
{
20 // Getting instance starts the class automatically if it hasn't been
22 static DeviceUMA
* GetInstance();
27 friend struct base::DefaultSingletonTraits
<DeviceUMA
>;
30 ~DeviceUMA() override
;
32 // ui::PlatformEventObserver:
33 void WillProcessEvent(const ui::PlatformEvent
& event
) override
;
34 void DidProcessEvent(const ui::PlatformEvent
& event
) override
;
36 // Check CrOS touchpad events to see if the metrics gesture is present
37 void CheckTouchpadEvent(XEvent
* event
);
39 // Check the incoming events for interesting patterns that we care about.
40 void CheckIncomingEvent(XEvent
* event
);
44 DISALLOW_COPY_AND_ASSIGN(DeviceUMA
);
47 } // namespace chromeos
49 #endif // CHROME_BROWSER_CHROMEOS_DEVICE_UMA_H_