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

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

Issue 875513005: [PATCH 10/11] ozone: evdev: Add a device factory proxy that forwards to device thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates for events_unittests 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
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 3130f6b6d112930b38ff14e6c9c2e2c8d86fe3aa..265b3c7253c14b2bee3682355f34d16b3dab401e 100644
--- a/ui/events/ozone/evdev/event_factory_evdev.cc
+++ b/ui/events/ozone/evdev/event_factory_evdev.cc
@@ -16,6 +16,7 @@
#include "ui/events/ozone/evdev/cursor_delegate_evdev.h"
#include "ui/events/ozone/evdev/input_controller_evdev.h"
#include "ui/events/ozone/evdev/input_device_factory_evdev.h"
+#include "ui/events/ozone/evdev/input_device_factory_proxy_evdev.h"
#include "ui/events/ozone/evdev/input_injector_evdev.h"
namespace ui {
@@ -139,9 +140,12 @@ void EventFactoryEvdev::Init() {
weak_ptr_factory_.GetWeakPtr()));
input_device_factory_.reset(
new InputDeviceFactoryEvdev(dispatcher.Pass(), cursor_));
+ input_device_factory_proxy_.reset(
+ new InputDeviceFactoryProxyEvdev(base::ThreadTaskRunnerHandle::Get(),
+ input_device_factory_->GetWeakPtr()));
// TODO(spang): This settings interface is really broken. crbug.com/450899
- input_controller_.SetInputDeviceFactory(input_device_factory_.get());
+ input_controller_.SetInputDeviceFactory(input_device_factory_proxy_.get());
// Scan & monitor devices.
device_manager_->AddObserver(this);
@@ -291,12 +295,12 @@ void EventFactoryEvdev::OnDeviceEvent(const DeviceEvent& event) {
case DeviceEvent::ADD:
case DeviceEvent::CHANGE: {
TRACE_EVENT1("ozone", "OnDeviceAdded", "path", event.path().value());
- input_device_factory_->AddInputDevice(NextDeviceId(), event.path());
+ input_device_factory_proxy_->AddInputDevice(NextDeviceId(), event.path());
break;
}
case DeviceEvent::REMOVE: {
TRACE_EVENT1("ozone", "OnDeviceRemoved", "path", event.path().value());
- input_device_factory_->RemoveInputDevice(event.path());
+ input_device_factory_proxy_->RemoveInputDevice(event.path());
break;
}
}

Powered by Google App Engine
This is Rietveld 408576698