| 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 7dc288fc76554faced493aace085ca541eea1f16..fe9812c05bb83ee1c131730bd3e84f2195669eff 100644
|
| --- a/ui/events/ozone/evdev/event_factory_evdev.cc
|
| +++ b/ui/events/ozone/evdev/event_factory_evdev.cc
|
| @@ -22,6 +22,7 @@
|
| #if defined(USE_EVDEV_GESTURES)
|
| #include "ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.h"
|
| #include "ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.h"
|
| +#include "ui/events/ozone/evdev/libgestures_glue/gesture_property_provider.h"
|
| #endif
|
|
|
| #ifndef EVIOCSCLOCKID
|
| @@ -50,13 +51,19 @@ scoped_ptr<EventConverterEvdev> CreateConverter(
|
| const EventDeviceInfo& devinfo,
|
| const EventDispatchCallback& dispatch,
|
| EventModifiersEvdev* modifiers,
|
| - CursorDelegateEvdev* cursor) {
|
| + CursorDelegateEvdev* cursor
|
| +#if defined(USE_EVDEV_GESTURES)
|
| + ,
|
| + GesturePropertyProvider* prop_provider
|
| +#endif
|
| + ) {
|
| #if defined(USE_EVDEV_GESTURES)
|
| // Touchpad or mouse: use gestures library.
|
| // EventReaderLibevdevCros -> GestureInterpreterLibevdevCros -> DispatchEvent
|
| if (UseGesturesLibraryForDevice(devinfo)) {
|
| - scoped_ptr<GestureInterpreterLibevdevCros> gesture_interp = make_scoped_ptr(
|
| - new GestureInterpreterLibevdevCros(modifiers, cursor, dispatch));
|
| + scoped_ptr<GestureInterpreterLibevdevCros> gesture_interp =
|
| + make_scoped_ptr(new GestureInterpreterLibevdevCros(
|
| + modifiers, cursor, prop_provider, dispatch));
|
| scoped_ptr<EventReaderLibevdevCros> libevdev_reader =
|
| make_scoped_ptr(new EventReaderLibevdevCros(
|
| fd,
|
| @@ -86,7 +93,11 @@ scoped_ptr<EventConverterEvdev> CreateConverter(
|
| void OpenInputDevice(
|
| const base::FilePath& path,
|
| EventModifiersEvdev* modifiers,
|
| - CursorDelegateEvdev* cursor,
|
| + CursorDelegateEvdev* cursor
|
| +#if defined(USE_EVDEV_GESTURES)
|
| + ,
|
| + GesturePropertyProvider* prop_provider,
|
| +#endif
|
| scoped_refptr<base::TaskRunner> reply_runner,
|
| const EventDispatchCallback& dispatch,
|
| base::Callback<void(scoped_ptr<EventConverterEvdev>)> reply_callback) {
|
| @@ -112,8 +123,17 @@ void OpenInputDevice(
|
| return;
|
| }
|
|
|
| - scoped_ptr<EventConverterEvdev> converter =
|
| - CreateConverter(fd, path, devinfo, dispatch, modifiers, cursor);
|
| + scoped_ptr<EventConverterEvdev> converter = CreateConverter(fd,
|
| + path,
|
| + devinfo,
|
| + dispatch,
|
| + modifiers,
|
| + cursor
|
| +#if defined(USE_EVDEV_GESTURES)
|
| + ,
|
| + prop_provider
|
| +#endif
|
| + );
|
|
|
| // Reply with the constructed converter.
|
| reply_runner->PostTask(FROM_HERE,
|
| @@ -131,11 +151,14 @@ void CloseInputDevice(const base::FilePath& path,
|
|
|
| } // namespace
|
|
|
| -EventFactoryEvdev::EventFactoryEvdev(
|
| - CursorDelegateEvdev* cursor,
|
| - DeviceManager* device_manager)
|
| +EventFactoryEvdev::EventFactoryEvdev(CursorDelegateEvdev* cursor,
|
| + DeviceManager* device_manager)
|
| : device_manager_(device_manager),
|
| - cursor_(cursor),
|
| + cursor_(cursor)
|
| +#if defined(USE_EVDEV_GESTURES)
|
| + ,
|
| + gesture_prop_provider_(new GesturePropertyProvider),
|
| +#endif
|
| dispatch_callback_(
|
| base::Bind(base::IgnoreResult(&EventFactoryEvdev::DispatchUiEvent),
|
| base::Unretained(this))),
|
| @@ -180,7 +203,11 @@ void EventFactoryEvdev::OnDeviceEvent(const DeviceEvent& event) {
|
| base::Bind(&OpenInputDevice,
|
| event.path(),
|
| &modifiers_,
|
| - cursor_,
|
| + cursor_
|
| +#if defined(USE_EVDEV_GESTURES)
|
| + ,
|
| + gesture_prop_provider_.get(),
|
| +#endif
|
| ui_task_runner_,
|
| dispatch_callback_,
|
| base::Bind(&EventFactoryEvdev::AttachInputDevice,
|
|
|