| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_DEVICE_UMA_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DEVICE_UMA_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DEVICE_UMA_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DEVICE_UMA_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "ui/events/platform/platform_event_observer.h" | 9 #include "ui/events/platform/platform_event_observer.h" |
| 10 | 10 |
| 11 namespace base { |
| 11 template <typename T> struct DefaultSingletonTraits; | 12 template <typename T> struct DefaultSingletonTraits; |
| 13 } |
| 12 | 14 |
| 13 namespace chromeos { | 15 namespace chromeos { |
| 14 | 16 |
| 15 // A class to record devices' input event details via the UMA system | 17 // A class to record devices' input event details via the UMA system |
| 16 class DeviceUMA : public ui::PlatformEventObserver { | 18 class DeviceUMA : public ui::PlatformEventObserver { |
| 17 public: | 19 public: |
| 18 // Getting instance starts the class automatically if it hasn't been | 20 // Getting instance starts the class automatically if it hasn't been |
| 19 // started before. | 21 // started before. |
| 20 static DeviceUMA* GetInstance(); | 22 static DeviceUMA* GetInstance(); |
| 21 | 23 |
| 22 void Stop(); | 24 void Stop(); |
| 23 | 25 |
| 24 private: | 26 private: |
| 25 friend struct DefaultSingletonTraits<DeviceUMA>; | 27 friend struct base::DefaultSingletonTraits<DeviceUMA>; |
| 26 | 28 |
| 27 DeviceUMA(); | 29 DeviceUMA(); |
| 28 ~DeviceUMA() override; | 30 ~DeviceUMA() override; |
| 29 | 31 |
| 30 // ui::PlatformEventObserver: | 32 // ui::PlatformEventObserver: |
| 31 void WillProcessEvent(const ui::PlatformEvent& event) override; | 33 void WillProcessEvent(const ui::PlatformEvent& event) override; |
| 32 void DidProcessEvent(const ui::PlatformEvent& event) override; | 34 void DidProcessEvent(const ui::PlatformEvent& event) override; |
| 33 | 35 |
| 34 // Check CrOS touchpad events to see if the metrics gesture is present | 36 // Check CrOS touchpad events to see if the metrics gesture is present |
| 35 void CheckTouchpadEvent(XEvent* event); | 37 void CheckTouchpadEvent(XEvent* event); |
| 36 | 38 |
| 37 // Check the incoming events for interesting patterns that we care about. | 39 // Check the incoming events for interesting patterns that we care about. |
| 38 void CheckIncomingEvent(XEvent* event); | 40 void CheckIncomingEvent(XEvent* event); |
| 39 | 41 |
| 40 bool stopped_; | 42 bool stopped_; |
| 41 | 43 |
| 42 DISALLOW_COPY_AND_ASSIGN(DeviceUMA); | 44 DISALLOW_COPY_AND_ASSIGN(DeviceUMA); |
| 43 }; | 45 }; |
| 44 | 46 |
| 45 } // namespace chromeos | 47 } // namespace chromeos |
| 46 | 48 |
| 47 #endif // CHROME_BROWSER_CHROMEOS_DEVICE_UMA_H_ | 49 #endif // CHROME_BROWSER_CHROMEOS_DEVICE_UMA_H_ |
| OLD | NEW |