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

Unified Diff: ui/events/device_data_manager.h

Issue 618283003: Adds special support to the device manager for keyboards devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change in ozone. Created 6 years, 2 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/device_data_manager.h
diff --git a/ui/events/device_data_manager.h b/ui/events/device_data_manager.h
index aae827204cc5e7e11aae927a68e244c587cb5469..132b9a90c9f81a9315f148d6eebb4cb3cbc104c3 100644
--- a/ui/events/device_data_manager.h
+++ b/ui/events/device_data_manager.h
@@ -14,6 +14,7 @@
#include "base/observer_list.h"
#include "ui/events/device_hotplug_event_observer.h"
#include "ui/events/events_base_export.h"
+#include "ui/events/keyboard_device.h"
#include "ui/events/touchscreen_device.h"
#include "ui/gfx/transform.h"
@@ -44,6 +45,10 @@ class EVENTS_BASE_EXPORT DeviceDataManager : public DeviceHotplugEventObserver {
return touchscreen_devices_;
}
+ const std::vector<KeyboardDevice>& keyboard_devices() const {
+ return keyboard_devices_;
+ }
+
void AddObserver(InputDeviceEventObserver* observer);
void RemoveObserver(InputDeviceEventObserver* observer);
@@ -54,15 +59,17 @@ class EVENTS_BASE_EXPORT DeviceDataManager : public DeviceHotplugEventObserver {
static const int kMaxDeviceNum = 128;
+ // DeviceHotplugEventObserver:
+ virtual void OnTouchscreenDevicesUpdated(
+ const std::vector<TouchscreenDevice>& devices) override;
+ virtual void OnKeyboardDevicesUpdated(
+ const std::vector<KeyboardDevice>& devices) override;
+
private:
static DeviceDataManager* instance_;
bool IsTouchDeviceIdValid(int touch_device_id) const;
- // DeviceHotplugEventObserver:
- virtual void OnTouchscreenDevicesUpdated(
- const std::vector<TouchscreenDevice>& devices) OVERRIDE;
-
double touch_radius_scale_map_[kMaxDeviceNum];
// Table to keep track of which display id is mapped to which touch device.
@@ -71,6 +78,7 @@ class EVENTS_BASE_EXPORT DeviceDataManager : public DeviceHotplugEventObserver {
gfx::Transform touch_device_transformer_map_[kMaxDeviceNum];
std::vector<TouchscreenDevice> touchscreen_devices_;
+ std::vector<KeyboardDevice> keyboard_devices_;
ObserverList<InputDeviceEventObserver> observers_;

Powered by Google App Engine
This is Rietveld 408576698