#define CHROME_BROWSER_CHROMEOS_DEVICE_UMA_H_
#include "base/basictypes.h"
-#include "base/event_types.h"
-#include "base/message_loop/message_loop.h"
+#include "ui/events/platform/platform_event_observer.h"
template <typename T> struct DefaultSingletonTraits;
namespace chromeos {
// A class to record devices' input event details via the UMA system
-class DeviceUMA : public base::MessageLoopForUI::Observer {
+class DeviceUMA : public ui::PlatformEventObserver {
public:
// Getting instance starts the class automatically if it hasn't been
// started before.
DeviceUMA();
virtual ~DeviceUMA();
- // Start and stop observing events.
- void AddMessageLoopObserver();
- void RemoveMessageLoopObserver();
-
- // MessageLoopForUI::Observer overrides.
- virtual base::EventStatus WillProcessEvent(
- const base::NativeEvent& event) OVERRIDE;
- virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE;
+ // ui::PlatformEventObserver:
+ virtual void WillProcessEvent(const ui::PlatformEvent& event) OVERRIDE;
+ virtual void DidProcessEvent(const ui::PlatformEvent& event) OVERRIDE;
// Check CrOS touchpad events to see if the metrics gesture is present
- void CheckTouchpadEvent(const base::NativeEvent& event);
+ void CheckTouchpadEvent(XEvent* event);
// Check the incoming events for interesting patterns that we care about.
- void CheckIncomingEvent(const base::NativeEvent& event);
+ void CheckIncomingEvent(XEvent* event);
- bool is_observing_;
+ bool stopped_;
DISALLOW_COPY_AND_ASSIGN(DeviceUMA);
};