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 "base/event_types.h"
10 #include "base/message_loop/message_loop.h"
12 template <typename T> struct DefaultSingletonTraits;
16 // A class to record devices' input event details via the UMA system
17 class DeviceUMA : public base::MessageLoopForUI::Observer {
19 // Getting instance starts the class automatically if it hasn't been
21 static DeviceUMA* GetInstance();
26 friend struct DefaultSingletonTraits<DeviceUMA>;
31 // Start and stop observing events.
32 void AddMessageLoopObserver();
33 void RemoveMessageLoopObserver();
35 // MessageLoopForUI::Observer overrides.
36 virtual base::EventStatus WillProcessEvent(
37 const base::NativeEvent& event) OVERRIDE;
38 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE;
40 // Check CrOS touchpad events to see if the metrics gesture is present
41 void CheckTouchpadEvent(const base::NativeEvent& event);
43 // Check the incoming events for interesting patterns that we care about.
44 void CheckIncomingEvent(const base::NativeEvent& event);
48 DISALLOW_COPY_AND_ASSIGN(DeviceUMA);
51 } // namespace chromeos
53 #endif // CHROME_BROWSER_CHROMEOS_DEVICE_UMA_H_