Index: ui/events/ozone/evdev/event_factory_evdev.cc |
diff --git a/ui/events/ozone/evdev/event_factory_evdev.cc b/ui/events/ozone/evdev/event_factory_evdev.cc |
index b5a0cb75cdba1defeba1cb5c64ef4bdfdb280a87..ea8766d103b0a96db500f9081ffd1214f854006d 100644 |
--- a/ui/events/ozone/evdev/event_factory_evdev.cc |
+++ b/ui/events/ozone/evdev/event_factory_evdev.cc |
@@ -62,9 +62,8 @@ struct OpenInputDeviceParams { |
#if defined(USE_EVDEV_GESTURES) |
bool UseGesturesLibraryForDevice(const EventDeviceInfo& devinfo) { |
- if ((devinfo.HasAbsXY() || devinfo.HasMTAbsXY()) && |
- !devinfo.IsMappedToScreen()) |
- return true; // touchpad |
+ if (devinfo.HasTouchpad()) |
+ return true; |
if (devinfo.HasRelXY()) |
return true; // mouse |
@@ -315,6 +314,49 @@ void EventFactoryEvdev::WarpCursorTo(gfx::AcceleratedWidget widget, |
} |
} |
+void EventFactoryEvdev::DisableInternalTouchpad() { |
+ for (const auto& it : converters_) { |
+ EventConverterEvdev* converter = it.second; |
+ if (converter->type() == InputDeviceType::INPUT_DEVICE_INTERNAL && |
+ converter->HasTouchpad()) { |
+ DCHECK(!converter->HasKeyboard()); |
+ converter->set_ignore_events(true); |
+ } |
+ } |
+} |
+ |
+void EventFactoryEvdev::EnableInternalTouchpad() { |
+ for (const auto& it : converters_) { |
+ EventConverterEvdev* converter = it.second; |
+ if (converter->type() == InputDeviceType::INPUT_DEVICE_INTERNAL && |
+ converter->HasTouchpad()) { |
+ DCHECK(!converter->HasKeyboard()); |
+ converter->set_ignore_events(false); |
+ } |
+ } |
+} |
+ |
+void EventFactoryEvdev::DisableInternalKeyboardExceptKeys( |
+ scoped_ptr<std::set<DomCode>> excepted_keys) { |
+ for (const auto& it : converters_) { |
+ EventConverterEvdev* converter = it.second; |
+ if (converter->type() == InputDeviceType::INPUT_DEVICE_INTERNAL && |
+ converter->HasKeyboard()) { |
+ converter->SetAllowedKeys(excepted_keys.Pass()); |
+ } |
+ } |
+} |
+ |
+void EventFactoryEvdev::EnableInternalKeyboard() { |
+ for (const auto& it : converters_) { |
+ EventConverterEvdev* converter = it.second; |
+ if (converter->type() == InputDeviceType::INPUT_DEVICE_INTERNAL && |
+ converter->HasKeyboard()) { |
+ converter->AllowAllKeys(); |
+ } |
+ } |
+} |
+ |
void EventFactoryEvdev::NotifyDeviceChange( |
const EventConverterEvdev& converter) { |
if (converter.HasTouchscreen()) |