| Index: ui/events/devices/input_device_service.h
|
| diff --git a/ui/events/devices/input_device_service.h b/ui/events/devices/input_device_service.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..5f3a4668924e9f8a3b75958186566b652ea87f6a
|
| --- /dev/null
|
| +++ b/ui/events/devices/input_device_service.h
|
| @@ -0,0 +1,46 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef UI_EVENTS_DEVICES_INPUT_DEVICE_SERVICE_H_
|
| +#define UI_EVENTS_DEVICES_INPUT_DEVICE_SERVICE_H_
|
| +
|
| +#include <vector>
|
| +
|
| +#include "base/macros.h"
|
| +#include "ui/events/devices/events_devices_export.h"
|
| +#include "ui/events/devices/input_device.h"
|
| +#include "ui/events/devices/input_device_event_observer.h"
|
| +
|
| +namespace ui {
|
| +
|
| +// Abstract interface to query about input devices that are available. Holds a
|
| +// pointer to implementation that provides these services.
|
| +// TODO(kylechar): DeviceDataManager should also implement this interface.
|
| +class EVENTS_DEVICES_EXPORT InputDeviceService {
|
| + public:
|
| + InputDeviceService() {}
|
| +
|
| + static InputDeviceService* GetInstance();
|
| +
|
| + virtual void AddObserver(InputDeviceEventObserver* observer) = 0;
|
| + virtual void RemoveObserver(InputDeviceEventObserver* observer) = 0;
|
| +
|
| + virtual const std::vector<InputDevice>& keyboard_devices() = 0;
|
| + virtual const std::vector<InputDevice>& touchscreen_devices() = 0;
|
| + virtual const std::vector<InputDevice>& mouse_devices() = 0;
|
| + virtual const std::vector<InputDevice>& touchpad_devices() = 0;
|
| +
|
| + protected:
|
| + static void SetInstance(InputDeviceService* instance);
|
| + static void ClearInstance();
|
| +
|
| + private:
|
| + static InputDeviceService* instance_; // Not owned.
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(InputDeviceService);
|
| +};
|
| +
|
| +} // namespace ui
|
| +
|
| +#endif // UI_EVENTS_DEVICES_INPUT_DEVICE_SERVICE_H_
|
|
|