Chromium Code Reviews| 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 51927e4327be15081838d9b071b033260d4c7260..8fa8727e97b8ec49357e0d8808cb1d6f7440a9aa 100644 |
| --- a/ui/events/devices/x11/device_data_manager_x11.cc |
| +++ b/ui/events/devices/x11/device_data_manager_x11.cc |
| @@ -13,6 +13,7 @@ |
| #include "base/bind.h" |
| #include "base/bind_helpers.h" |
| +#include "base/command_line.h" |
| #include "base/logging.h" |
| #include "base/macros.h" |
| #include "base/memory/singleton.h" |
| @@ -21,6 +22,7 @@ |
| #include "ui/display/display.h" |
| #include "ui/events/devices/x11/device_list_cache_x11.h" |
| #include "ui/events/devices/x11/touch_factory_x11.h" |
| +#include "ui/events/devices/x11/ui_events_devices_x11_switches.h" |
| #include "ui/events/event_constants.h" |
| #include "ui/events/event_switches.h" |
| #include "ui/events/keycodes/keyboard_code_conversion_x.h" |
| @@ -124,6 +126,11 @@ Iterator FindDeviceWithId(Iterator begin, Iterator end, int id) { |
| return end; |
| } |
| +bool IsHighPrecisionScrollingDisabled() { |
| + return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kDisableHighPrecisionScrolling); |
| +} |
| + |
| } // namespace |
| bool DeviceDataManagerX11::IsCMTDataType(const int type) { |
| @@ -155,6 +162,7 @@ DeviceDataManagerX11* DeviceDataManagerX11::GetInstance() { |
| DeviceDataManagerX11::DeviceDataManagerX11() |
| : xi_opcode_(-1), |
| + high_precision_scrolling_disabled_(IsHighPrecisionScrollingDisabled()), |
| atom_cache_(gfx::GetXDisplay(), kCachedAtoms), |
| button_map_count_(0) { |
| CHECK(gfx::GetXDisplay()); |
| @@ -771,9 +779,9 @@ void DeviceDataManagerX11::UpdateScrollClassDevice( |
| DCHECK(deviceid >= 0 && deviceid < kMaxDeviceNum); |
| ScrollInfo& info = scroll_data_[deviceid]; |
| - // TODO: xinput2 is disabled until edge cases are fixed. |
| - // http://crbug.com/616308 |
| - return; |
| + if (high_precision_scrolling_disabled_) { |
| + return; |
| + } |
|
sadrul
2016/07/20 17:02:26
no {}
Move after the DCHECK() above
Will Shackleton
2016/07/25 20:53:38
Done.
|
| bool legacy_scroll_available = |
| (scroll_class_info->flags & XIScrollFlagNoEmulation) == 0; |