Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / chromeos / device_uma.h
blobad71e5b275d82127ed069288ab32909fc74b6265
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;
14 namespace chromeos {
16 // A class to record devices' input event details via the UMA system
17 class DeviceUMA : public base::MessageLoopForUI::Observer {
18 public:
19 // Getting instance starts the class automatically if it hasn't been
20 // started before.
21 static DeviceUMA* GetInstance();
23 void Stop();
25 private:
26 friend struct DefaultSingletonTraits<DeviceUMA>;
28 DeviceUMA();
29 virtual ~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);
46 bool is_observing_;
48 DISALLOW_COPY_AND_ASSIGN(DeviceUMA);
51 } // namespace chromeos
53 #endif // CHROME_BROWSER_CHROMEOS_DEVICE_UMA_H_