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

Unified Diff: ui/events/platform/x11/x11_hotplug_event_handler.cc

Issue 1097393011: Revert of Ozone support for device special cases in keyboard event rewriting. (patchset #6 id:12000… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 @@ const char* kCachedAtomList[] = {
XI_MOUSE,
XI_TOUCHPAD,
XI_TOUCHSCREEN,
- XI_PROP_PRODUCT_ID,
NULL,
};
@@ -118,13 +113,9 @@ struct TouchClassInfo {
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 @@ struct DeviceInfo {
// 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 @@ void HandleKeyboardDevicesInWorker(
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 @@ void HandleMouseDevicesInWorker(const std::vector<DeviceInfo>& device_infos,
}
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 @@ void HandleTouchpadDevicesInWorker(const std::vector<DeviceInfo>& device_infos,
}
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 @@ void HandleTouchscreenDevicesInWorker(
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 @@ void X11HotplugEventHandler::OnHotplugEvent() {
(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 @@ void X11HotplugEventHandler::OnHotplugEvent() {
// 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
« no previous file with comments | « ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698