| Index: ui/events/devices/x11/touch_factory_x11.cc
|
| diff --git a/ui/events/devices/x11/touch_factory_x11.cc b/ui/events/devices/x11/touch_factory_x11.cc
|
| index 37dba7ceb85a92982fc6c26a26de3ccfe603718d..c2a3848eb4b8b8c20550708e8e5222a54b3f59aa 100644
|
| --- a/ui/events/devices/x11/touch_factory_x11.cc
|
| +++ b/ui/events/devices/x11/touch_factory_x11.cc
|
| @@ -27,25 +27,11 @@
|
|
|
| namespace ui {
|
|
|
| -namespace {
|
| -
|
| -bool IsTouchEventsFlagDisabled() {
|
| - auto* command_line = base::CommandLine::ForCurrentProcess();
|
| - bool touch_flag_status = command_line->HasSwitch(switches::kTouchEvents) &&
|
| - command_line->GetSwitchValueASCII(switches::kTouchEvents) ==
|
| - switches::kTouchEventsDisabled;
|
| - return touch_flag_status;
|
| -}
|
| -
|
| -} // namespace
|
| -
|
| -
|
| TouchFactory::TouchFactory()
|
| : pointer_device_lookup_(),
|
| touch_device_list_(),
|
| virtual_core_keyboard_device_(-1),
|
| id_generator_(0),
|
| - touch_events_flag_disabled_(IsTouchEventsFlagDisabled()),
|
| touch_screens_enabled_(true) {
|
| if (!DeviceDataManagerX11::GetInstance()->IsXInput2Available())
|
| return;
|
| @@ -158,9 +144,6 @@ bool TouchFactory::ShouldProcessXI2Event(XEvent* xev) {
|
| XIEvent* event = static_cast<XIEvent*>(xev->xcookie.data);
|
| XIDeviceEvent* xiev = reinterpret_cast<XIDeviceEvent*>(event);
|
|
|
| - const bool is_touch_disabled =
|
| - touch_events_flag_disabled_ && !touch_screens_enabled_;
|
| -
|
| if (event->evtype == XI_TouchBegin ||
|
| event->evtype == XI_TouchUpdate ||
|
| event->evtype == XI_TouchEnd) {
|
| @@ -177,8 +160,7 @@ bool TouchFactory::ShouldProcessXI2Event(XEvent* xev) {
|
| bool is_from_master_or_float = touch_device_list_[xiev->deviceid];
|
| bool is_from_slave_device = !is_from_master_or_float
|
| && xiev->sourceid == xiev->deviceid;
|
| - return !is_touch_disabled &&
|
| - IsTouchDevice(xiev->deviceid) &&
|
| + return touch_screens_enabled_ && IsTouchDevice(xiev->deviceid) &&
|
| !is_from_slave_device;
|
| }
|
|
|
| @@ -197,7 +179,7 @@ bool TouchFactory::ShouldProcessXI2Event(XEvent* xev) {
|
| if (!pointer_device_lookup_[xiev->deviceid])
|
| return false;
|
|
|
| - return IsTouchDevice(xiev->deviceid) ? !is_touch_disabled : true;
|
| + return IsTouchDevice(xiev->deviceid) ? touch_screens_enabled_ : true;
|
| }
|
|
|
| void TouchFactory::SetupXI2ForXWindow(Window window) {
|
| @@ -293,9 +275,7 @@ void TouchFactory::ReleaseSlotForTrackingID(uint32_t tracking_id) {
|
| }
|
|
|
| bool TouchFactory::IsTouchDevicePresent() {
|
| - return !touch_events_flag_disabled_ &&
|
| - touch_screens_enabled_ &&
|
| - touch_device_lookup_.any();
|
| + return touch_screens_enabled_ && touch_device_lookup_.any();
|
| }
|
|
|
| void TouchFactory::ResetForTest() {
|
| @@ -304,7 +284,6 @@ void TouchFactory::ResetForTest() {
|
| touch_device_list_.clear();
|
| touchscreen_ids_.clear();
|
| id_generator_.ResetForTest();
|
| - touch_events_flag_disabled_ = false;
|
| SetTouchscreensEnabled(true);
|
| }
|
|
|
| @@ -318,7 +297,6 @@ void TouchFactory::SetTouchDeviceForTest(
|
| touch_device_lookup_[*iter] = true;
|
| touch_device_list_[*iter] = true;
|
| }
|
| - touch_events_flag_disabled_ = false;
|
| SetTouchscreensEnabled(true);
|
| }
|
|
|
|
|