| Index: ui/events/device_data_manager.h
|
| diff --git a/ui/events/device_data_manager.h b/ui/events/device_data_manager.h
|
| index 54c139b1302b021e22fe7496900d965b336e8a4c..d419e13ca870bf767ba380b2c5a3530196e9e101 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"
|
|
|
| @@ -24,6 +25,7 @@ class InputDeviceEventObserver;
|
| // Keeps track of device mappings and event transformations.
|
| class EVENTS_BASE_EXPORT DeviceDataManager : public DeviceHotplugEventObserver {
|
| public:
|
| + static const int kMaxDeviceNum = 128;
|
| virtual ~DeviceDataManager();
|
|
|
| static void CreateInstance();
|
| @@ -32,18 +34,22 @@ class EVENTS_BASE_EXPORT DeviceDataManager : public DeviceHotplugEventObserver {
|
|
|
| void ClearTouchTransformerRecord();
|
| void UpdateTouchInfoForDisplay(int64_t display_id,
|
| - int touch_device_id,
|
| + unsigned int touch_device_id,
|
| const gfx::Transform& touch_transformer);
|
| - void ApplyTouchTransformer(int touch_device_id, float* x, float* y);
|
| - int64_t GetDisplayForTouchDevice(int touch_device_id) const;
|
| + void ApplyTouchTransformer(unsigned int touch_device_id, float* x, float* y);
|
| + int64_t GetDisplayForTouchDevice(unsigned int touch_device_id) const;
|
|
|
| - void UpdateTouchRadiusScale(int touch_device_id, double scale);
|
| - void ApplyTouchRadiusScale(int touch_device_id, double* radius);
|
| + void UpdateTouchRadiusScale(unsigned int touch_device_id, double scale);
|
| + void ApplyTouchRadiusScale(unsigned int touch_device_id, double* radius);
|
|
|
| const std::vector<TouchscreenDevice>& touchscreen_devices() const {
|
| return touchscreen_devices_;
|
| }
|
|
|
| + const std::vector<KeyboardDevice>& keyboard_devices() const {
|
| + return keyboard_devices_;
|
| + }
|
| +
|
| void AddObserver(InputDeviceEventObserver* observer);
|
| void RemoveObserver(InputDeviceEventObserver* observer);
|
|
|
| @@ -52,16 +58,16 @@ class EVENTS_BASE_EXPORT DeviceDataManager : public DeviceHotplugEventObserver {
|
|
|
| static DeviceDataManager* instance();
|
|
|
| - 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;
|
| + bool IsTouchDeviceIdValid(unsigned int touch_device_id) const;
|
|
|
| double touch_radius_scale_map_[kMaxDeviceNum];
|
|
|
| @@ -71,6 +77,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_;
|
|
|
|
|