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

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

Issue 291473002: ozone: Initialize a subsystem only if necessary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 b1c5c4c381d947b959042348253d0a65dc28dcd0..9203e10d4467409280accd76d64198863dcbd7e9 100644
--- a/ui/events/ozone/evdev/event_factory_evdev.cc
+++ b/ui/events/ozone/evdev/event_factory_evdev.cc
@@ -206,6 +206,13 @@ void EventFactoryEvdev::OnDeviceEvent(const DeviceEvent& event) {
}
}
+void EventFactoryEvdev::OnDispatcherListChanged() {
+ if (ui_task_runner_)
+ return;
+ ui_task_runner_ = base::MessageLoopProxy::current();
+ StartProcessingEvents();
+}
+
void EventFactoryEvdev::DetachInputDevice(const base::FilePath& path) {
TRACE_EVENT1("ozone", "DetachInputDevice", "path", path.value());
CHECK(ui_task_runner_->RunsTasksOnCurrentThread());
@@ -228,6 +235,8 @@ void EventFactoryEvdev::DetachInputDevice(const base::FilePath& path) {
}
void EventFactoryEvdev::StartProcessingEvents() {
+ if (!ui_task_runner_)
+ return;
CHECK(ui_task_runner_->RunsTasksOnCurrentThread());
if (device_manager_ && !has_started_processing_events_) {

Powered by Google App Engine
This is Rietveld 408576698