Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(563)

Unified Diff: ui/events/devices/input_device_service.h

Issue 1992443002: Add Mojo IPC based input-device service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup_ddm
Patch Set: Clean up/move files. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698