Commit 6f83c7da authored by pkotwicz's avatar pkotwicz Committed by Commit bot

Remove useless InputDevice::name field

BUG=None
TEST=None
R=sadrul
TBR=oshima

Review URL: https://codereview.chromium.org/904733002

Cr-Commit-Position: refs/heads/master@{#315072}
parent e2b6ce8d
...@@ -17,14 +17,13 @@ void VirtualKeyboardTestHelper::SuppressKeyboard() { ...@@ -17,14 +17,13 @@ void VirtualKeyboardTestHelper::SuppressKeyboard() {
ui::DeviceHotplugEventObserver* manager = ui::DeviceHotplugEventObserver* manager =
ui::DeviceDataManager::GetInstance(); ui::DeviceDataManager::GetInstance();
std::vector<ui::TouchscreenDevice> screens; std::vector<ui::TouchscreenDevice> screens;
screens.push_back( screens.push_back(ui::TouchscreenDevice(
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, 1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, gfx::Size(1024, 768), 0));
"Touchscreen", gfx::Size(1024, 768), 0));
manager->OnTouchscreenDevicesUpdated(screens); manager->OnTouchscreenDevicesUpdated(screens);
std::vector<ui::KeyboardDevice> keyboards; std::vector<ui::KeyboardDevice> keyboards;
keyboards.push_back(ui::KeyboardDevice( keyboards.push_back(
2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard")); ui::KeyboardDevice(2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL));
manager->OnKeyboardDevicesUpdated(keyboards); manager->OnKeyboardDevicesUpdated(keyboards);
} }
......
...@@ -33,7 +33,7 @@ DisplayInfo CreateDisplayInfo(int64 id, ...@@ -33,7 +33,7 @@ DisplayInfo CreateDisplayInfo(int64 id,
ui::TouchscreenDevice CreateTouchscreenDevice(unsigned int id, ui::TouchscreenDevice CreateTouchscreenDevice(unsigned int id,
const gfx::Size& size) { const gfx::Size& size) {
return ui::TouchscreenDevice(id, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, return ui::TouchscreenDevice(id, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL,
std::string(), size, 0); size, 0);
} }
} // namespace } // namespace
......
...@@ -76,12 +76,10 @@ TEST_F(TouchscreenUtilTest, NoTouchscreens) { ...@@ -76,12 +76,10 @@ TEST_F(TouchscreenUtilTest, NoTouchscreens) {
TEST_F(TouchscreenUtilTest, OneToOneMapping) { TEST_F(TouchscreenUtilTest, OneToOneMapping) {
std::vector<ui::TouchscreenDevice> devices; std::vector<ui::TouchscreenDevice> devices;
devices.push_back( devices.push_back(ui::TouchscreenDevice(
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "", 1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, gfx::Size(800, 600), 0));
gfx::Size(800, 600), 0)); devices.push_back(ui::TouchscreenDevice(
devices.push_back( 2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, gfx::Size(1024, 768), 0));
ui::TouchscreenDevice(2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "",
gfx::Size(1024, 768), 0));
AssociateTouchscreens(&displays_, devices); AssociateTouchscreens(&displays_, devices);
...@@ -93,9 +91,8 @@ TEST_F(TouchscreenUtilTest, OneToOneMapping) { ...@@ -93,9 +91,8 @@ TEST_F(TouchscreenUtilTest, OneToOneMapping) {
TEST_F(TouchscreenUtilTest, MapToCorrectDisplaySize) { TEST_F(TouchscreenUtilTest, MapToCorrectDisplaySize) {
std::vector<ui::TouchscreenDevice> devices; std::vector<ui::TouchscreenDevice> devices;
devices.push_back( devices.push_back(ui::TouchscreenDevice(
ui::TouchscreenDevice(2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "", 2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, gfx::Size(1024, 768), 0));
gfx::Size(1024, 768), 0));
AssociateTouchscreens(&displays_, devices); AssociateTouchscreens(&displays_, devices);
...@@ -107,12 +104,10 @@ TEST_F(TouchscreenUtilTest, MapToCorrectDisplaySize) { ...@@ -107,12 +104,10 @@ TEST_F(TouchscreenUtilTest, MapToCorrectDisplaySize) {
TEST_F(TouchscreenUtilTest, MapWhenSizeDiffersByOne) { TEST_F(TouchscreenUtilTest, MapWhenSizeDiffersByOne) {
std::vector<ui::TouchscreenDevice> devices; std::vector<ui::TouchscreenDevice> devices;
devices.push_back( devices.push_back(ui::TouchscreenDevice(
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "", 1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, gfx::Size(801, 600), 0));
gfx::Size(801, 600), 0)); devices.push_back(ui::TouchscreenDevice(
devices.push_back( 2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, gfx::Size(1023, 768), 0));
ui::TouchscreenDevice(2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "",
gfx::Size(1023, 768), 0));
AssociateTouchscreens(&displays_, devices); AssociateTouchscreens(&displays_, devices);
...@@ -124,12 +119,10 @@ TEST_F(TouchscreenUtilTest, MapWhenSizeDiffersByOne) { ...@@ -124,12 +119,10 @@ TEST_F(TouchscreenUtilTest, MapWhenSizeDiffersByOne) {
TEST_F(TouchscreenUtilTest, MapWhenSizesDoNotMatch) { TEST_F(TouchscreenUtilTest, MapWhenSizesDoNotMatch) {
std::vector<ui::TouchscreenDevice> devices; std::vector<ui::TouchscreenDevice> devices;
devices.push_back( devices.push_back(ui::TouchscreenDevice(
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "", 1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, gfx::Size(1022, 768), 0));
gfx::Size(1022, 768), 0)); devices.push_back(ui::TouchscreenDevice(
devices.push_back( 2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, gfx::Size(802, 600), 0));
ui::TouchscreenDevice(2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "",
gfx::Size(802, 600), 0));
AssociateTouchscreens(&displays_, devices); AssociateTouchscreens(&displays_, devices);
...@@ -141,12 +134,10 @@ TEST_F(TouchscreenUtilTest, MapWhenSizesDoNotMatch) { ...@@ -141,12 +134,10 @@ TEST_F(TouchscreenUtilTest, MapWhenSizesDoNotMatch) {
TEST_F(TouchscreenUtilTest, MapInternalTouchscreen) { TEST_F(TouchscreenUtilTest, MapInternalTouchscreen) {
std::vector<ui::TouchscreenDevice> devices; std::vector<ui::TouchscreenDevice> devices;
devices.push_back( devices.push_back(ui::TouchscreenDevice(
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "", 1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, gfx::Size(1920, 1080), 0));
gfx::Size(1920, 1080), 0)); devices.push_back(ui::TouchscreenDevice(
devices.push_back( 2, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, gfx::Size(9999, 888), 0));
ui::TouchscreenDevice(2, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "",
gfx::Size(9999, 888), 0));
AssociateTouchscreens(&displays_, devices); AssociateTouchscreens(&displays_, devices);
......
...@@ -84,8 +84,8 @@ class MockEventBlocker : public ScopedDisableInternalMouseAndKeyboard { ...@@ -84,8 +84,8 @@ class MockEventBlocker : public ScopedDisableInternalMouseAndKeyboard {
MockEventBlocker() {} MockEventBlocker() {}
~MockEventBlocker() override { ~MockEventBlocker() override {
std::vector<ui::KeyboardDevice> keyboards; std::vector<ui::KeyboardDevice> keyboards;
keyboards.push_back(ui::KeyboardDevice( keyboards.push_back(
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "keyboard")); ui::KeyboardDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL));
ui::DeviceHotplugEventObserver* manager = ui::DeviceHotplugEventObserver* manager =
ui::DeviceDataManager::GetInstance(); ui::DeviceDataManager::GetInstance();
manager->OnKeyboardDevicesUpdated(keyboards); manager->OnKeyboardDevicesUpdated(keyboards);
...@@ -157,13 +157,12 @@ class VirtualKeyboardControllerAutoTest : public VirtualKeyboardControllerTest, ...@@ -157,13 +157,12 @@ class VirtualKeyboardControllerAutoTest : public VirtualKeyboardControllerTest,
// present. // present.
TEST_F(VirtualKeyboardControllerAutoTest, DisabledIfInternalKeyboardPresent) { TEST_F(VirtualKeyboardControllerAutoTest, DisabledIfInternalKeyboardPresent) {
std::vector<ui::TouchscreenDevice> screens; std::vector<ui::TouchscreenDevice> screens;
screens.push_back( screens.push_back(ui::TouchscreenDevice(
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, 1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, gfx::Size(1024, 768), 0));
"Touchscreen", gfx::Size(1024, 768), 0));
UpdateTouchscreenDevices(screens); UpdateTouchscreenDevices(screens);
std::vector<ui::KeyboardDevice> keyboards; std::vector<ui::KeyboardDevice> keyboards;
keyboards.push_back(ui::KeyboardDevice( keyboards.push_back(
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "keyboard")); ui::KeyboardDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL));
UpdateKeyboardDevices(keyboards); UpdateKeyboardDevices(keyboards);
ASSERT_FALSE(keyboard::IsKeyboardEnabled()); ASSERT_FALSE(keyboard::IsKeyboardEnabled());
// Remove the internal keyboard. Virtual keyboard should now show. // Remove the internal keyboard. Virtual keyboard should now show.
...@@ -177,9 +176,8 @@ TEST_F(VirtualKeyboardControllerAutoTest, DisabledIfInternalKeyboardPresent) { ...@@ -177,9 +176,8 @@ TEST_F(VirtualKeyboardControllerAutoTest, DisabledIfInternalKeyboardPresent) {
TEST_F(VirtualKeyboardControllerAutoTest, DisabledIfNoTouchScreen) { TEST_F(VirtualKeyboardControllerAutoTest, DisabledIfNoTouchScreen) {
std::vector<ui::TouchscreenDevice> devices; std::vector<ui::TouchscreenDevice> devices;
// Add a touchscreen. Keyboard should deploy. // Add a touchscreen. Keyboard should deploy.
devices.push_back( devices.push_back(ui::TouchscreenDevice(
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, 1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, gfx::Size(800, 600), 0));
"Touchscreen", gfx::Size(800, 600), 0));
UpdateTouchscreenDevices(devices); UpdateTouchscreenDevices(devices);
EXPECT_TRUE(keyboard::IsKeyboardEnabled()); EXPECT_TRUE(keyboard::IsKeyboardEnabled());
// Remove touchscreen. Keyboard should hide. // Remove touchscreen. Keyboard should hide.
...@@ -189,13 +187,12 @@ TEST_F(VirtualKeyboardControllerAutoTest, DisabledIfNoTouchScreen) { ...@@ -189,13 +187,12 @@ TEST_F(VirtualKeyboardControllerAutoTest, DisabledIfNoTouchScreen) {
TEST_F(VirtualKeyboardControllerAutoTest, SuppressedIfExternalKeyboardPresent) { TEST_F(VirtualKeyboardControllerAutoTest, SuppressedIfExternalKeyboardPresent) {
std::vector<ui::TouchscreenDevice> screens; std::vector<ui::TouchscreenDevice> screens;
screens.push_back( screens.push_back(ui::TouchscreenDevice(
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, 1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, gfx::Size(1024, 768), 0));
"Touchscreen", gfx::Size(1024, 768), 0));
UpdateTouchscreenDevices(screens); UpdateTouchscreenDevices(screens);
std::vector<ui::KeyboardDevice> keyboards; std::vector<ui::KeyboardDevice> keyboards;
keyboards.push_back(ui::KeyboardDevice( keyboards.push_back(
1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard")); ui::KeyboardDevice(1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL));
UpdateKeyboardDevices(keyboards); UpdateKeyboardDevices(keyboards);
ASSERT_FALSE(keyboard::IsKeyboardEnabled()); ASSERT_FALSE(keyboard::IsKeyboardEnabled());
ASSERT_TRUE(notified()); ASSERT_TRUE(notified());
...@@ -228,12 +225,12 @@ TEST_F(VirtualKeyboardControllerAutoTest, SuppressedIfExternalKeyboardPresent) { ...@@ -228,12 +225,12 @@ TEST_F(VirtualKeyboardControllerAutoTest, SuppressedIfExternalKeyboardPresent) {
// Tests handling multiple keyboards. Catches crbug.com/430252 // Tests handling multiple keyboards. Catches crbug.com/430252
TEST_F(VirtualKeyboardControllerAutoTest, HandleMultipleKeyboardsPresent) { TEST_F(VirtualKeyboardControllerAutoTest, HandleMultipleKeyboardsPresent) {
std::vector<ui::KeyboardDevice> keyboards; std::vector<ui::KeyboardDevice> keyboards;
keyboards.push_back(ui::KeyboardDevice( keyboards.push_back(
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "keyboard")); ui::KeyboardDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL));
keyboards.push_back(ui::KeyboardDevice( keyboards.push_back(
2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard")); ui::KeyboardDevice(2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL));
keyboards.push_back(ui::KeyboardDevice( keyboards.push_back(
3, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard")); ui::KeyboardDevice(3, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL));
UpdateKeyboardDevices(keyboards); UpdateKeyboardDevices(keyboards);
ASSERT_FALSE(keyboard::IsKeyboardEnabled()); ASSERT_FALSE(keyboard::IsKeyboardEnabled());
} }
...@@ -259,13 +256,12 @@ class VirtualKeyboardControllerAlwaysEnabledTest ...@@ -259,13 +256,12 @@ class VirtualKeyboardControllerAlwaysEnabledTest
// keyboard always enabled flag is active. // keyboard always enabled flag is active.
TEST_F(VirtualKeyboardControllerAlwaysEnabledTest, DoesNotSuppressKeyboard) { TEST_F(VirtualKeyboardControllerAlwaysEnabledTest, DoesNotSuppressKeyboard) {
std::vector<ui::TouchscreenDevice> screens; std::vector<ui::TouchscreenDevice> screens;
screens.push_back( screens.push_back(ui::TouchscreenDevice(
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, 1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, gfx::Size(1024, 768), 0));
"Touchscreen", gfx::Size(1024, 768), 0));
UpdateTouchscreenDevices(screens); UpdateTouchscreenDevices(screens);
std::vector<ui::KeyboardDevice> keyboards; std::vector<ui::KeyboardDevice> keyboards;
keyboards.push_back(ui::KeyboardDevice( keyboards.push_back(
1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard")); ui::KeyboardDevice(1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL));
UpdateKeyboardDevices(keyboards); UpdateKeyboardDevices(keyboards);
ASSERT_TRUE(keyboard::IsKeyboardEnabled()); ASSERT_TRUE(keyboard::IsKeyboardEnabled());
} }
......
...@@ -15,10 +15,8 @@ InputDevice::InputDevice() ...@@ -15,10 +15,8 @@ InputDevice::InputDevice()
: id(kInvalidId), type(InputDeviceType::INPUT_DEVICE_UNKNOWN) { : id(kInvalidId), type(InputDeviceType::INPUT_DEVICE_UNKNOWN) {
} }
InputDevice::InputDevice(unsigned int id, InputDevice::InputDevice(unsigned int id, InputDeviceType type)
InputDeviceType type, : id(id), type(type) {
const std::string& name)
: id(id), type(type), name(name) {
} }
InputDevice::~InputDevice() { InputDevice::~InputDevice() {
......
...@@ -24,7 +24,7 @@ struct EVENTS_DEVICES_EXPORT InputDevice { ...@@ -24,7 +24,7 @@ struct EVENTS_DEVICES_EXPORT InputDevice {
// Creates an invalid input device. // Creates an invalid input device.
InputDevice(); InputDevice();
InputDevice(unsigned int id, InputDeviceType type, const std::string& name); InputDevice(unsigned int id, InputDeviceType type);
virtual ~InputDevice(); virtual ~InputDevice();
// ID of the device. This ID is unique between all input devices. // ID of the device. This ID is unique between all input devices.
...@@ -32,9 +32,6 @@ struct EVENTS_DEVICES_EXPORT InputDevice { ...@@ -32,9 +32,6 @@ struct EVENTS_DEVICES_EXPORT InputDevice {
// The type of the input device. // The type of the input device.
InputDeviceType type; InputDeviceType type;
// Name of the device.
std::string name;
}; };
} // namespace ui } // namespace ui
......
...@@ -10,10 +10,8 @@ ...@@ -10,10 +10,8 @@
namespace ui { namespace ui {
KeyboardDevice::KeyboardDevice(int id, KeyboardDevice::KeyboardDevice(int id, InputDeviceType type)
InputDeviceType type, : InputDevice(id, type) {
const std::string& name)
: InputDevice(id, type, name) {
} }
} // namespace ui } // namespace ui
...@@ -14,7 +14,7 @@ namespace ui { ...@@ -14,7 +14,7 @@ namespace ui {
// Represents a Keyboard device state. // Represents a Keyboard device state.
struct EVENTS_DEVICES_EXPORT KeyboardDevice : public InputDevice { struct EVENTS_DEVICES_EXPORT KeyboardDevice : public InputDevice {
KeyboardDevice(int id, InputDeviceType type, const std::string& name); KeyboardDevice(int id, InputDeviceType type);
}; };
} // namespace ui } // namespace ui
......
...@@ -15,10 +15,9 @@ TouchscreenDevice::TouchscreenDevice() : touch_points(0) { ...@@ -15,10 +15,9 @@ TouchscreenDevice::TouchscreenDevice() : touch_points(0) {
TouchscreenDevice::TouchscreenDevice(unsigned int id, TouchscreenDevice::TouchscreenDevice(unsigned int id,
InputDeviceType type, InputDeviceType type,
const std::string& name,
const gfx::Size& size, const gfx::Size& size,
int touch_points) int touch_points)
: InputDevice(id, type, name), size(size), touch_points(touch_points) { : InputDevice(id, type), size(size), touch_points(touch_points) {
} }
} // namespace ui } // namespace ui
...@@ -20,7 +20,6 @@ struct EVENTS_DEVICES_EXPORT TouchscreenDevice : public InputDevice { ...@@ -20,7 +20,6 @@ struct EVENTS_DEVICES_EXPORT TouchscreenDevice : public InputDevice {
TouchscreenDevice(unsigned int id, TouchscreenDevice(unsigned int id,
InputDeviceType type, InputDeviceType type,
const std::string& name,
const gfx::Size& size, const gfx::Size& size,
int touch_points); int touch_points);
......
...@@ -80,10 +80,10 @@ TEST_F(DeviceDataManagerX11Test, NotifyOnDisable) { ...@@ -80,10 +80,10 @@ TEST_F(DeviceDataManagerX11Test, NotifyOnDisable) {
DeviceDataManagerX11* manager = DeviceDataManagerX11::GetInstance(); DeviceDataManagerX11* manager = DeviceDataManagerX11::GetInstance();
TestInputDeviceObserver observer(manager); TestInputDeviceObserver observer(manager);
std::vector<ui::KeyboardDevice> keyboards; std::vector<ui::KeyboardDevice> keyboards;
keyboards.push_back(ui::KeyboardDevice( keyboards.push_back(
1u, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard")); ui::KeyboardDevice(1u, ui::InputDeviceType::INPUT_DEVICE_INTERNAL));
keyboards.push_back(ui::KeyboardDevice( keyboards.push_back(
2u, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard")); ui::KeyboardDevice(2u, ui::InputDeviceType::INPUT_DEVICE_INTERNAL));
SetKeyboardDevices(keyboards); SetKeyboardDevices(keyboards);
EXPECT_TRUE(observer.change_notified()); EXPECT_TRUE(observer.change_notified());
std::vector<KeyboardDevice> devices = manager->keyboard_devices(); std::vector<KeyboardDevice> devices = manager->keyboard_devices();
...@@ -111,10 +111,10 @@ TEST_F(DeviceDataManagerX11Test, TestMultipleDisable) { ...@@ -111,10 +111,10 @@ TEST_F(DeviceDataManagerX11Test, TestMultipleDisable) {
DeviceDataManagerX11* manager = DeviceDataManagerX11::GetInstance(); DeviceDataManagerX11* manager = DeviceDataManagerX11::GetInstance();
TestInputDeviceObserver observer(manager); TestInputDeviceObserver observer(manager);
std::vector<ui::KeyboardDevice> keyboards; std::vector<ui::KeyboardDevice> keyboards;
keyboards.push_back(ui::KeyboardDevice( keyboards.push_back(
1u, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard")); ui::KeyboardDevice(1u, ui::InputDeviceType::INPUT_DEVICE_INTERNAL));
keyboards.push_back(ui::KeyboardDevice( keyboards.push_back(
2u, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard")); ui::KeyboardDevice(2u, ui::InputDeviceType::INPUT_DEVICE_INTERNAL));
SetKeyboardDevices(keyboards); SetKeyboardDevices(keyboards);
EXPECT_TRUE(observer.change_notified()); EXPECT_TRUE(observer.change_notified());
std::vector<KeyboardDevice> devices = manager->keyboard_devices(); std::vector<KeyboardDevice> devices = manager->keyboard_devices();
...@@ -150,10 +150,10 @@ TEST_F(DeviceDataManagerX11Test, UnblockOnDeviceUnplugged) { ...@@ -150,10 +150,10 @@ TEST_F(DeviceDataManagerX11Test, UnblockOnDeviceUnplugged) {
DeviceDataManagerX11* manager = DeviceDataManagerX11::GetInstance(); DeviceDataManagerX11* manager = DeviceDataManagerX11::GetInstance();
TestInputDeviceObserver observer(manager); TestInputDeviceObserver observer(manager);
std::vector<ui::KeyboardDevice> all_keyboards; std::vector<ui::KeyboardDevice> all_keyboards;
all_keyboards.push_back(ui::KeyboardDevice( all_keyboards.push_back(
1u, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard")); ui::KeyboardDevice(1u, ui::InputDeviceType::INPUT_DEVICE_INTERNAL));
all_keyboards.push_back(ui::KeyboardDevice( all_keyboards.push_back(
2u, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard")); ui::KeyboardDevice(2u, ui::InputDeviceType::INPUT_DEVICE_INTERNAL));
SetKeyboardDevices(all_keyboards); SetKeyboardDevices(all_keyboards);
EXPECT_TRUE(observer.change_notified()); EXPECT_TRUE(observer.change_notified());
std::vector<KeyboardDevice> devices = manager->keyboard_devices(); std::vector<KeyboardDevice> devices = manager->keyboard_devices();
...@@ -168,8 +168,8 @@ TEST_F(DeviceDataManagerX11Test, UnblockOnDeviceUnplugged) { ...@@ -168,8 +168,8 @@ TEST_F(DeviceDataManagerX11Test, UnblockOnDeviceUnplugged) {
// Unplug the disabled device. Should not be notified, since the active list // Unplug the disabled device. Should not be notified, since the active list
// did not change. // did not change.
std::vector<ui::KeyboardDevice> subset_keyboards; std::vector<ui::KeyboardDevice> subset_keyboards;
subset_keyboards.push_back(ui::KeyboardDevice( subset_keyboards.push_back(
1u, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard")); ui::KeyboardDevice(1u, ui::InputDeviceType::INPUT_DEVICE_INTERNAL));
SetKeyboardDevices(subset_keyboards); SetKeyboardDevices(subset_keyboards);
EXPECT_FALSE(observer.change_notified()); EXPECT_FALSE(observer.change_notified());
// Replug in the first device. Should be notified of the new device. // Replug in the first device. Should be notified of the new device.
......
...@@ -440,8 +440,8 @@ void InputDeviceFactoryEvdev::NotifyTouchscreensUpdated() { ...@@ -440,8 +440,8 @@ void InputDeviceFactoryEvdev::NotifyTouchscreensUpdated() {
// TODO(spang): Extract the number of touch-points supported by the // TODO(spang): Extract the number of touch-points supported by the
// device. // device.
const int touch_points = 11; const int touch_points = 11;
touchscreens.push_back(TouchscreenDevice( touchscreens.push_back(
it->second->id(), it->second->type(), std::string() /* Device name */, TouchscreenDevice(it->second->id(), it->second->type(),
it->second->GetTouchscreenSize(), touch_points)); it->second->GetTouchscreenSize(), touch_points));
} }
} }
...@@ -453,8 +453,7 @@ void InputDeviceFactoryEvdev::NotifyKeyboardsUpdated() { ...@@ -453,8 +453,7 @@ void InputDeviceFactoryEvdev::NotifyKeyboardsUpdated() {
std::vector<KeyboardDevice> keyboards; std::vector<KeyboardDevice> keyboards;
for (auto it = converters_.begin(); it != converters_.end(); ++it) { for (auto it = converters_.begin(); it != converters_.end(); ++it) {
if (it->second->HasKeyboard()) { if (it->second->HasKeyboard()) {
keyboards.push_back(KeyboardDevice(it->second->id(), it->second->type(), keyboards.push_back(KeyboardDevice(it->second->id(), it->second->type()));
std::string() /* Device name */));
} }
} }
...@@ -464,10 +463,8 @@ void InputDeviceFactoryEvdev::NotifyKeyboardsUpdated() { ...@@ -464,10 +463,8 @@ void InputDeviceFactoryEvdev::NotifyKeyboardsUpdated() {
void InputDeviceFactoryEvdev::NotifyMouseDevicesUpdated() { void InputDeviceFactoryEvdev::NotifyMouseDevicesUpdated() {
std::vector<InputDevice> mice; std::vector<InputDevice> mice;
for (auto it = converters_.begin(); it != converters_.end(); ++it) { for (auto it = converters_.begin(); it != converters_.end(); ++it) {
if (it->second->HasMouse()) { if (it->second->HasMouse())
mice.push_back(InputDevice(it->second->id(), it->second->type(), mice.push_back(InputDevice(it->second->id(), it->second->type()));
std::string() /* Device name */));
}
} }
dispatcher_->DispatchMouseDevicesUpdated(mice); dispatcher_->DispatchMouseDevicesUpdated(mice);
...@@ -476,10 +473,8 @@ void InputDeviceFactoryEvdev::NotifyMouseDevicesUpdated() { ...@@ -476,10 +473,8 @@ void InputDeviceFactoryEvdev::NotifyMouseDevicesUpdated() {
void InputDeviceFactoryEvdev::NotifyTouchpadDevicesUpdated() { void InputDeviceFactoryEvdev::NotifyTouchpadDevicesUpdated() {
std::vector<InputDevice> touchpads; std::vector<InputDevice> touchpads;
for (auto it = converters_.begin(); it != converters_.end(); ++it) { for (auto it = converters_.begin(); it != converters_.end(); ++it) {
if (it->second->HasTouchpad()) { if (it->second->HasTouchpad())
touchpads.push_back(InputDevice(it->second->id(), it->second->type(), touchpads.push_back(InputDevice(it->second->id(), it->second->type()));
std::string() /* Device name */));
}
} }
dispatcher_->DispatchTouchpadDevicesUpdated(touchpads); dispatcher_->DispatchTouchpadDevicesUpdated(touchpads);
......
...@@ -225,8 +225,7 @@ void HandleKeyboardDevicesInWorker( ...@@ -225,8 +225,7 @@ void HandleKeyboardDevicesInWorker(
if (IsKnownInvalidKeyboardDevice(device_name)) if (IsKnownInvalidKeyboardDevice(device_name))
continue; // Skip invalid devices. continue; // Skip invalid devices.
InputDeviceType type = GetInputDeviceTypeFromPath(device_info.path); InputDeviceType type = GetInputDeviceTypeFromPath(device_info.path);
devices.push_back( devices.push_back(KeyboardDevice(device_info.id, type));
KeyboardDevice(device_info.id, type, device_name));
} }
reply_runner->PostTask(FROM_HERE, base::Bind(callback, devices)); reply_runner->PostTask(FROM_HERE, base::Bind(callback, devices));
...@@ -278,9 +277,8 @@ void HandleTouchscreenDevicesInWorker( ...@@ -278,9 +277,8 @@ void HandleTouchscreenDevicesInWorker(
InputDeviceType type = GetInputDeviceTypeFromPath(device_info.path); InputDeviceType type = GetInputDeviceTypeFromPath(device_info.path);
// |max_x| and |max_y| are inclusive values, so we need to add 1 to get // |max_x| and |max_y| are inclusive values, so we need to add 1 to get
// the size. // the size.
devices.push_back( devices.push_back(TouchscreenDevice(
TouchscreenDevice(device_info.id, type, device_info.name, device_info.id, type, gfx::Size(max_x + 1, max_y + 1),
gfx::Size(max_x + 1, max_y + 1),
device_info.touch_class_info.num_touches)); device_info.touch_class_info.num_touches));
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment