| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 UI_EVENTS_DEVICES_INPUT_DEVICE_MANAGER_H_ | 5 #ifndef UI_EVENTS_DEVICES_INPUT_DEVICE_MANAGER_H_ |
| 6 #define UI_EVENTS_DEVICES_INPUT_DEVICE_MANAGER_H_ | 6 #define UI_EVENTS_DEVICES_INPUT_DEVICE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 InputDeviceManager() {} | 24 InputDeviceManager() {} |
| 25 | 25 |
| 26 static InputDeviceManager* GetInstance(); | 26 static InputDeviceManager* GetInstance(); |
| 27 static bool HasInstance(); | 27 static bool HasInstance(); |
| 28 | 28 |
| 29 virtual const std::vector<InputDevice>& GetKeyboardDevices() const = 0; | 29 virtual const std::vector<InputDevice>& GetKeyboardDevices() const = 0; |
| 30 virtual const std::vector<TouchscreenDevice>& GetTouchscreenDevices() | 30 virtual const std::vector<TouchscreenDevice>& GetTouchscreenDevices() |
| 31 const = 0; | 31 const = 0; |
| 32 virtual const std::vector<InputDevice>& GetMouseDevices() const = 0; | 32 virtual const std::vector<InputDevice>& GetMouseDevices() const = 0; |
| 33 virtual const std::vector<InputDevice>& GetTouchpadDevices() const = 0; | 33 virtual const std::vector<InputDevice>& GetTouchpadDevices() const = 0; |
| 34 virtual const std::vector<InputDevice>& GetGamepadDevices() const = 0; |
| 34 | 35 |
| 35 virtual bool AreDeviceListsComplete() const = 0; | 36 virtual bool AreDeviceListsComplete() const = 0; |
| 36 virtual bool AreTouchscreensEnabled() const = 0; | 37 virtual bool AreTouchscreensEnabled() const = 0; |
| 37 | 38 |
| 38 virtual void AddObserver(InputDeviceEventObserver* observer) = 0; | 39 virtual void AddObserver(InputDeviceEventObserver* observer) = 0; |
| 39 virtual void RemoveObserver(InputDeviceEventObserver* observer) = 0; | 40 virtual void RemoveObserver(InputDeviceEventObserver* observer) = 0; |
| 40 | 41 |
| 41 protected: | 42 protected: |
| 42 // Sets the instance. This should only be set once per process. | 43 // Sets the instance. This should only be set once per process. |
| 43 static void SetInstance(InputDeviceManager* instance); | 44 static void SetInstance(InputDeviceManager* instance); |
| 44 | 45 |
| 45 // Clears the instance. InputDeviceManager doesn't own the instance and won't | 46 // Clears the instance. InputDeviceManager doesn't own the instance and won't |
| 46 // destroy it, so it should be cleared before it is destroyed elsewhere. | 47 // destroy it, so it should be cleared before it is destroyed elsewhere. |
| 47 static void ClearInstance(); | 48 static void ClearInstance(); |
| 48 | 49 |
| 49 private: | 50 private: |
| 50 static InputDeviceManager* instance_; // Not owned. | 51 static InputDeviceManager* instance_; // Not owned. |
| 51 | 52 |
| 52 DISALLOW_COPY_AND_ASSIGN(InputDeviceManager); | 53 DISALLOW_COPY_AND_ASSIGN(InputDeviceManager); |
| 53 }; | 54 }; |
| 54 | 55 |
| 55 } // namespace ui | 56 } // namespace ui |
| 56 | 57 |
| 57 #endif // UI_EVENTS_DEVICES_INPUT_DEVICE_MANAGER_H_ | 58 #endif // UI_EVENTS_DEVICES_INPUT_DEVICE_MANAGER_H_ |
| OLD | NEW |