#ifndef UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_
#define UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/task_runner.h"
#include "ui/events/events_export.h"
#include "ui/events/ozone/evdev/event_converter_evdev.h"
#include "ui/events/ozone/evdev/event_modifiers_evdev.h"
#include "ui/events/ozone/event_factory_ozone.h"
namespace ui {
class CursorDelegateEvdev;
class DeviceManagerEvdev;
class EVENTS_EXPORT EventFactoryEvdev : public EventFactoryOzone {
public:
EventFactoryEvdev();
explicit EventFactoryEvdev(CursorDelegateEvdev* cursor);
virtual ~EventFactoryEvdev();
virtual void StartProcessingEvents() OVERRIDE;
virtual void SetFileTaskRunner(scoped_refptr<base::TaskRunner> task_runner)
OVERRIDE;
virtual void WarpCursorTo(gfx::AcceleratedWidget widget,
const gfx::PointF& location) OVERRIDE;
private:
void AttachInputDevice(const base::FilePath& file_path,
scoped_ptr<EventConverterEvdev> converter);
void DetachInputDevice(const base::FilePath& file_path);
void OnDeviceAdded(const base::FilePath& path);
void OnDeviceRemoved(const base::FilePath& path);
std::map<base::FilePath, EventConverterEvdev*> converters_;
scoped_ptr<DeviceManagerEvdev> device_manager_;
scoped_refptr<base::TaskRunner> ui_task_runner_;
scoped_refptr<base::TaskRunner> file_task_runner_;
EventModifiersEvdev modifiers_;
CursorDelegateEvdev* cursor_;
base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev);
};
}
#endif