Index: ui/events/platform/x11/x11_hotplug_event_handler.cc |
diff --git a/ui/events/platform/x11/x11_hotplug_event_handler.cc b/ui/events/platform/x11/x11_hotplug_event_handler.cc |
index b4150586bf41737f594cffdf7e73d9f753a26226..5e69c23041eb9ed6133ed4ce29958cbed5b8d1f0 100644 |
--- a/ui/events/platform/x11/x11_hotplug_event_handler.cc |
+++ b/ui/events/platform/x11/x11_hotplug_event_handler.cc |
@@ -32,10 +32,6 @@ |
#include "ui/events/devices/touchscreen_device.h" |
#include "ui/gfx/x/x11_types.h" |
-#ifndef XI_PROP_PRODUCT_ID |
-#define XI_PROP_PRODUCT_ID "Device Product ID" |
-#endif |
- |
namespace ui { |
namespace { |
@@ -56,7 +52,6 @@ |
XI_MOUSE, |
XI_TOUCHPAD, |
XI_TOUCHSCREEN, |
- XI_PROP_PRODUCT_ID, |
NULL, |
}; |
@@ -118,13 +113,9 @@ |
struct DeviceInfo { |
DeviceInfo(const XIDeviceInfo& device, |
DeviceType type, |
- const base::FilePath& path, |
- uint16_t vendor, |
- uint16_t product) |
+ const base::FilePath& path) |
: id(device.deviceid), |
name(device.name), |
- vendor_id(vendor), |
- product_id(product), |
use(device.use), |
type(type), |
path(path) { |
@@ -153,10 +144,6 @@ |
// Internal device name. |
std::string name; |
- // USB-style device identifiers. |
- uint16_t vendor_id; |
- uint16_t product_id; |
- |
// Device type (ie: XIMasterPointer) |
int use; |
@@ -259,8 +246,7 @@ |
if (IsKnownInvalidKeyboardDevice(device_info.name)) |
continue; // Skip invalid devices. |
InputDeviceType type = GetInputDeviceTypeFromPath(device_info.path); |
- KeyboardDevice keyboard(device_info.id, type, device_info.name); |
- devices.push_back(keyboard); |
+ devices.push_back(KeyboardDevice(device_info.id, type)); |
} |
reply_runner->PostTask(FROM_HERE, base::Bind(callback, devices)); |
@@ -279,7 +265,7 @@ |
} |
InputDeviceType type = GetInputDeviceTypeFromPath(device_info.path); |
- devices.push_back(InputDevice(device_info.id, type, device_info.name)); |
+ devices.push_back(InputDevice(device_info.id, type)); |
} |
reply_runner->PostTask(FROM_HERE, base::Bind(callback, devices)); |
@@ -298,7 +284,7 @@ |
} |
InputDeviceType type = GetInputDeviceTypeFromPath(device_info.path); |
- devices.push_back(InputDevice(device_info.id, type, device_info.name)); |
+ devices.push_back(InputDevice(device_info.id, type)); |
} |
reply_runner->PostTask(FROM_HERE, base::Bind(callback, devices)); |
@@ -351,10 +337,9 @@ |
InputDeviceType type = GetInputDeviceTypeFromPath(device_info.path); |
// |max_x| and |max_y| are inclusive values, so we need to add 1 to get |
// the size. |
- devices.push_back( |
- TouchscreenDevice(device_info.id, type, device_info.name, |
- gfx::Size(max_x + 1, max_y + 1), |
- device_info.touch_class_info.num_touches)); |
+ devices.push_back(TouchscreenDevice( |
+ device_info.id, type, gfx::Size(max_x + 1, max_y + 1), |
+ device_info.touch_class_info.num_touches)); |
} |
} |
@@ -443,29 +428,8 @@ |
(device.deviceid >= 0 && device.deviceid < kMaxDeviceNum) |
? device_types[device.deviceid] |
: DEVICE_TYPE_OTHER; |
- |
- // Obtain the USB-style vendor and product identifiers. |
- // (On Linux, XI2 makes this available for all evdev devices. |
- uint32_t* product_info; |
- Atom type; |
- int format_return; |
- unsigned long num_items_return; |
- unsigned long bytes_after_return; |
- uint16_t vendor = 0; |
- uint16_t product = 0; |
- if (XIGetProperty(gfx::GetXDisplay(), device.deviceid, |
- atom_cache_.GetAtom(XI_PROP_PRODUCT_ID), 0, 2, 0, |
- XA_INTEGER, &type, &format_return, &num_items_return, |
- &bytes_after_return, |
- reinterpret_cast<unsigned char**>(&product_info)) == 0 && |
- product_info) { |
- vendor = product_info[0]; |
- product = product_info[1]; |
- XFree(product_info); |
- } |
- |
- device_infos.push_back(DeviceInfo( |
- device, device_type, GetDevicePath(display, device), vendor, product)); |
+ device_infos.push_back( |
+ DeviceInfo(device, device_type, GetDevicePath(display, device))); |
} |
// X11 is not thread safe, so first get all the required state. |
@@ -482,11 +446,13 @@ |
// Parsing the device information may block, so delegate the operation to a |
// worker thread. Once the device information is extracted the parsed devices |
// will be returned via the callbacks. |
- base::WorkerPool::PostTask( |
- FROM_HERE, |
- base::Bind(&HandleHotplugEventInWorker, device_infos, display_state, |
- base::ThreadTaskRunnerHandle::Get(), callbacks), |
- true /* task_is_slow */); |
+ base::WorkerPool::PostTask(FROM_HERE, |
+ base::Bind(&HandleHotplugEventInWorker, |
+ device_infos, |
+ display_state, |
+ base::ThreadTaskRunnerHandle::Get(), |
+ callbacks), |
+ true /* task_is_slow */); |
} |
} // namespace ui |