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

Unified Diff: ui/events/devices/x11/device_data_manager_x11.cc

Issue 2019413002: Remove KeyboardDevice class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/x11/device_data_manager_x11.cc
diff --git a/ui/events/devices/x11/device_data_manager_x11.cc b/ui/events/devices/x11/device_data_manager_x11.cc
index a4d1566d008d8281ba8c7bc96e3a3a8b951dba9f..613c022c1c0b458c0732cf94d9c4b5d09b74a5f7 100644
--- a/ui/events/devices/x11/device_data_manager_x11.cc
+++ b/ui/events/devices/x11/device_data_manager_x11.cc
@@ -19,7 +19,6 @@
#include "base/sys_info.h"
#include "build/build_config.h"
#include "ui/display/display.h"
-#include "ui/events/devices/keyboard_device.h"
#include "ui/events/devices/x11/device_list_cache_x11.h"
#include "ui/events/devices/x11/touch_factory_x11.h"
#include "ui/events/event_constants.h"
@@ -818,12 +817,11 @@ void DeviceDataManagerX11::SetDisabledKeyboardAllowedKeys(
void DeviceDataManagerX11::DisableDevice(int deviceid) {
blocked_devices_.set(deviceid, true);
// TODO(rsadam@): Support blocking touchscreen devices.
- std::vector<KeyboardDevice> keyboards = keyboard_devices();
- std::vector<KeyboardDevice>::iterator it =
+ std::vector<InputDevice> keyboards = keyboard_devices();
+ std::vector<InputDevice>::iterator it =
FindDeviceWithId(keyboards.begin(), keyboards.end(), deviceid);
if (it != std::end(keyboards)) {
- blocked_keyboards_.insert(
- std::pair<int, KeyboardDevice>(deviceid, *it));
+ blocked_keyboards_.insert(std::pair<int, InputDevice>(deviceid, *it));
keyboards.erase(it);
DeviceDataManager::OnKeyboardDevicesUpdated(keyboards);
}
@@ -831,10 +829,9 @@ void DeviceDataManagerX11::DisableDevice(int deviceid) {
void DeviceDataManagerX11::EnableDevice(int deviceid) {
blocked_devices_.set(deviceid, false);
- std::map<int, KeyboardDevice>::iterator it =
- blocked_keyboards_.find(deviceid);
+ std::map<int, InputDevice>::iterator it = blocked_keyboards_.find(deviceid);
if (it != blocked_keyboards_.end()) {
- std::vector<KeyboardDevice> devices = keyboard_devices();
+ std::vector<InputDevice> devices = keyboard_devices();
// Add device to current list of active devices.
devices.push_back((*it).second);
blocked_keyboards_.erase(it);
@@ -864,14 +861,14 @@ bool DeviceDataManagerX11::IsEventBlocked(const XEvent& xev) {
}
void DeviceDataManagerX11::OnKeyboardDevicesUpdated(
- const std::vector<KeyboardDevice>& devices) {
- std::vector<KeyboardDevice> keyboards(devices);
- for (std::map<int, KeyboardDevice>::iterator blocked_iter =
+ const std::vector<InputDevice>& devices) {
+ std::vector<InputDevice> keyboards(devices);
+ for (std::map<int, InputDevice>::iterator blocked_iter =
blocked_keyboards_.begin();
blocked_iter != blocked_keyboards_.end();) {
// Check if the blocked device still exists in list of devices.
int device_id = blocked_iter->first;
- std::vector<KeyboardDevice>::iterator it =
+ std::vector<InputDevice>::iterator it =
FindDeviceWithId(keyboards.begin(), keyboards.end(), device_id);
// If the device no longer exists, unblock it, else filter it out from our
// active list.

Powered by Google App Engine
This is Rietveld 408576698