| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_EVENTS_DEVICES_INPUT_DEVICE_SERVICE_H_ |
| 6 #define UI_EVENTS_DEVICES_INPUT_DEVICE_SERVICE_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "ui/events/devices/events_devices_export.h" |
| 12 #include "ui/events/devices/input_device.h" |
| 13 #include "ui/events/devices/input_device_event_observer.h" |
| 14 |
| 15 namespace ui { |
| 16 |
| 17 // Abstract interface to query about input devices that are available. Holds a |
| 18 // pointer to implementation that provides these services. |
| 19 // TODO(kylechar): DeviceDataManager should also implement this interface. |
| 20 class EVENTS_DEVICES_EXPORT InputDeviceService { |
| 21 public: |
| 22 InputDeviceService() {} |
| 23 |
| 24 static InputDeviceService* GetInstance(); |
| 25 |
| 26 virtual void AddObserver(InputDeviceEventObserver* observer) = 0; |
| 27 virtual void RemoveObserver(InputDeviceEventObserver* observer) = 0; |
| 28 |
| 29 virtual const std::vector<InputDevice>& keyboard_devices() = 0; |
| 30 virtual const std::vector<InputDevice>& touchscreen_devices() = 0; |
| 31 virtual const std::vector<InputDevice>& mouse_devices() = 0; |
| 32 virtual const std::vector<InputDevice>& touchpad_devices() = 0; |
| 33 |
| 34 protected: |
| 35 static void SetInstance(InputDeviceService* instance); |
| 36 static void ClearInstance(); |
| 37 |
| 38 private: |
| 39 static InputDeviceService* instance_; // Not owned. |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(InputDeviceService); |
| 42 }; |
| 43 |
| 44 } // namespace ui |
| 45 |
| 46 #endif // UI_EVENTS_DEVICES_INPUT_DEVICE_SERVICE_H_ |
| OLD | NEW |