Chromium Code Reviews| Index: device/hid/input_service_linux.h |
| diff --git a/device/hid/input_service_linux.h b/device/hid/input_service_linux.h |
| index 55bf70c1c682a1231795bdce2173c7c28d7bc147..d67daf8f5757aea43306487116b5df4b928073ff 100644 |
| --- a/device/hid/input_service_linux.h |
| +++ b/device/hid/input_service_linux.h |
| @@ -14,7 +14,7 @@ |
| #include "base/memory/scoped_ptr.h" |
| #include "base/message_loop/message_loop.h" |
| #include "base/observer_list.h" |
| -#include "base/threading/thread_checker.h" |
| + |
|
Ken Rockot(use gerrit already)
2015/02/20 17:15:03
nit: no blank line
merkulova
2015/02/24 09:10:16
Done.
|
| #include "device/hid/device_monitor_linux.h" |
| namespace device { |
| @@ -45,6 +45,8 @@ class InputServiceLinux : public base::MessageLoop::DestructionObserver { |
| bool is_touchscreen : 1; |
| }; |
| + typedef base::hash_map<std::string, InputDeviceInfo> DeviceMap; |
|
Ken Rockot(use gerrit already)
2015/02/20 17:15:03
nit: alias instead of typedef
merkulova
2015/02/24 09:10:16
Done.
|
| + |
| class Observer { |
| public: |
| virtual ~Observer() {} |
| @@ -53,42 +55,37 @@ class InputServiceLinux : public base::MessageLoop::DestructionObserver { |
| }; |
| InputServiceLinux(); |
| + ~InputServiceLinux() override; |
| static InputServiceLinux* GetInstance(); |
| static bool HasInstance(); |
| static void SetForTesting(InputServiceLinux* service); |
| - void AddObserver(Observer* observer); |
| - void RemoveObserver(Observer* observer); |
| + virtual void AddObserver(Observer* observer); |
| + virtual void RemoveObserver(Observer* observer); |
| // Returns list of all currently connected input/hid devices. |
| - void GetDevices(std::vector<InputDeviceInfo>* devices); |
| + virtual void GetDevices(std::vector<InputDeviceInfo>* devices); |
| // Returns an info about input device identified by |id|. When there're |
| // no input or hid device with such id, returns false and doesn't |
| // modify |info|. |
| - bool GetDeviceInfo(const std::string& id, InputDeviceInfo* info) const; |
| + virtual bool GetDeviceInfo( |
| + const std::string& id, InputDeviceInfo* info) const; |
| // Implements base::MessageLoop::DestructionObserver |
| void WillDestroyCurrentMessageLoop() override; |
| protected: |
| - ~InputServiceLinux() override; |
| - |
| - void AddDevice(const InputDeviceInfo& info); |
| - void RemoveDevice(const std::string& id); |
| - bool CalledOnValidThread() const; |
| - |
| - private: |
| - friend struct base::DefaultDeleter<InputServiceLinux>; |
| - |
| - typedef base::hash_map<std::string, InputDeviceInfo> DeviceMap; |
| + virtual void AddDevice(const InputDeviceInfo& info); |
| + virtual void RemoveDevice(const std::string& id); |
| DeviceMap devices_; |
| ObserverList<Observer> observers_; |
| - base::ThreadChecker thread_checker_; |
| + private: |
| + friend struct base::DefaultDeleter<InputServiceLinux>; |
| DISALLOW_COPY_AND_ASSIGN(InputServiceLinux); |
| }; |