Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Unified Diff: ui/events/ozone/evdev/event_factory_evdev.h

Issue 869613003: [PATCH 5/11] ozone: evdev: Replace dispatch callbacks with an interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: namespace ui Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/ozone/evdev/event_dispatch_callback.cc ('k') | ui/events/ozone/evdev/event_factory_evdev.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/event_factory_evdev.h
diff --git a/ui/events/ozone/evdev/event_factory_evdev.h b/ui/events/ozone/evdev/event_factory_evdev.h
index a14c68626f702ce86aecb1132739977f83f78418..bd22d57636171770d59a71a071ae94aec9684c30 100644
--- a/ui/events/ozone/evdev/event_factory_evdev.h
+++ b/ui/events/ozone/evdev/event_factory_evdev.h
@@ -14,6 +14,7 @@
#include "base/memory/ref_counted.h"
#include "base/task_runner.h"
#include "ui/events/ozone/device/device_event_observer.h"
+#include "ui/events/ozone/evdev/device_event_dispatcher_evdev.h"
#include "ui/events/ozone/evdev/event_converter_evdev.h"
#include "ui/events/ozone/evdev/event_device_info.h"
#include "ui/events/ozone/evdev/event_modifiers_evdev.h"
@@ -45,14 +46,19 @@ class GesturePropertyProvider;
#endif
// Ozone events implementation for the Linux input subsystem ("evdev").
-class EVENTS_OZONE_EVDEV_EXPORT EventFactoryEvdev : public DeviceEventObserver,
- public PlatformEventSource {
+class EVENTS_OZONE_EVDEV_EXPORT EventFactoryEvdev
+ : public DeviceEventObserver,
+ public PlatformEventSource,
+ public DeviceEventDispatcherEvdev {
public:
EventFactoryEvdev(CursorDelegateEvdev* cursor,
DeviceManager* device_manager,
KeyboardLayoutEngine* keyboard_layout_engine);
~EventFactoryEvdev() override;
+ // Initialize. Must be called with a valid message loop.
+ void Init();
+
// Get a list of device ids that matches a device type. Return true if the
// list is not empty. |device_ids| can be NULL.
bool GetDeviceIdsByType(const EventDeviceType type,
@@ -78,13 +84,13 @@ class EVENTS_OZONE_EVDEV_EXPORT EventFactoryEvdev : public DeviceEventObserver,
InputController* input_controller() { return &input_controller_; }
- // Post events to UI.
- void PostKeyEvent(const KeyEventParams& params);
- void PostMouseMoveEvent(const MouseMoveEventParams& params);
- void PostMouseButtonEvent(const MouseButtonEventParams& params);
- void PostMouseWheelEvent(const MouseWheelEventParams& parms);
- void PostScrollEvent(const ScrollEventParams& params);
- void PostTouchEvent(const TouchEventParams& params);
+ // DeviceEventDispatchEvdev:
+ void DispatchKeyEvent(const KeyEventParams& params) override;
+ void DispatchMouseMoveEvent(const MouseMoveEventParams& params) override;
+ void DispatchMouseButtonEvent(const MouseButtonEventParams& params) override;
+ void DispatchMouseWheelEvent(const MouseWheelEventParams& params) override;
+ void DispatchScrollEvent(const ScrollEventParams& params) override;
+ void DispatchTouchEvent(const TouchEventParams& params) override;
protected:
// DeviceEventObserver overrides:
@@ -150,6 +156,9 @@ class EVENTS_OZONE_EVDEV_EXPORT EventFactoryEvdev : public DeviceEventObserver,
// Object for controlling input devices.
InputControllerEvdev input_controller_;
+ // Whether we've set up the device factory & done initial scan.
+ bool initialized_;
+
// Support weak pointers for attach & detach callbacks.
base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_;
« no previous file with comments | « ui/events/ozone/evdev/event_dispatch_callback.cc ('k') | ui/events/ozone/evdev/event_factory_evdev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698