OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 DEVICE_HID_INPUT_SERVICE_LINUX_H_ | 5 #ifndef DEVICE_HID_INPUT_SERVICE_LINUX_H_ |
6 #define DEVICE_HID_INPUT_SERVICE_LINUX_H_ | 6 #define DEVICE_HID_INPUT_SERVICE_LINUX_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 ~InputServiceLinux() override; | 61 ~InputServiceLinux() override; |
62 | 62 |
63 static InputServiceLinux* GetInstance(); | 63 static InputServiceLinux* GetInstance(); |
64 static bool HasInstance(); | 64 static bool HasInstance(); |
65 static void SetForTesting(InputServiceLinux* service); | 65 static void SetForTesting(InputServiceLinux* service); |
66 | 66 |
67 void AddObserver(Observer* observer); | 67 void AddObserver(Observer* observer); |
68 void RemoveObserver(Observer* observer); | 68 void RemoveObserver(Observer* observer); |
69 | 69 |
70 // Returns list of all currently connected input/hid devices. | 70 // Returns list of all currently connected input/hid devices. |
71 void GetDevices(std::vector<InputDeviceInfo>* devices); | 71 virtual void GetDevices(std::vector<InputDeviceInfo>* devices); |
72 | 72 |
73 // Returns an info about input device identified by |id|. When there're | 73 // Returns an info about input device identified by |id|. When there're |
74 // no input or hid device with such id, returns false and doesn't | 74 // no input or hid device with such id, returns false and doesn't |
75 // modify |info|. | 75 // modify |info|. |
76 bool GetDeviceInfo(const std::string& id, InputDeviceInfo* info) const; | 76 bool GetDeviceInfo(const std::string& id, InputDeviceInfo* info) const; |
77 | 77 |
78 // Implements base::MessageLoop::DestructionObserver | 78 // Implements base::MessageLoop::DestructionObserver |
79 void WillDestroyCurrentMessageLoop() override; | 79 void WillDestroyCurrentMessageLoop() override; |
80 | 80 |
81 protected: | 81 protected: |
(...skipping 10 matching lines...) Expand all Loading... |
92 friend std::default_delete<InputServiceLinux>; | 92 friend std::default_delete<InputServiceLinux>; |
93 | 93 |
94 base::ThreadChecker thread_checker_; | 94 base::ThreadChecker thread_checker_; |
95 | 95 |
96 DISALLOW_COPY_AND_ASSIGN(InputServiceLinux); | 96 DISALLOW_COPY_AND_ASSIGN(InputServiceLinux); |
97 }; | 97 }; |
98 | 98 |
99 } // namespace device | 99 } // namespace device |
100 | 100 |
101 #endif // DEVICE_HID_INPUT_SERVICE_LINUX_H_ | 101 #endif // DEVICE_HID_INPUT_SERVICE_LINUX_H_ |
OLD | NEW |