Roll src/third_party/WebKit eac3800:0237a66 (svn 202606:202607)
[chromium-blink-merge.git] / chrome / browser / chromeos / device_uma.h
blobd6c16d6c6094209e78a9e3463d42c4fac0d86580
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"
11 namespace base {
12 template <typename T> struct DefaultSingletonTraits;
15 namespace chromeos {
17 // A class to record devices' input event details via the UMA system
18 class DeviceUMA : public ui::PlatformEventObserver {
19 public:
20 // Getting instance starts the class automatically if it hasn't been
21 // started before.
22 static DeviceUMA* GetInstance();
24 void Stop();
26 private:
27 friend struct base::DefaultSingletonTraits<DeviceUMA>;
29 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);
42 bool stopped_;
44 DISALLOW_COPY_AND_ASSIGN(DeviceUMA);
47 } // namespace chromeos
49 #endif // CHROME_BROWSER_CHROMEOS_DEVICE_UMA_H_