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

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: tot-merge-r270817 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
« no previous file with comments | « ui/events/ozone/evdev/event_factory_evdev.h ('k') | ui/events/ozone/event_factory_ozone.h » ('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.cc
diff --git a/ui/events/ozone/evdev/event_factory_evdev.cc b/ui/events/ozone/evdev/event_factory_evdev.cc
index 96e8113ef472ae0463b0d0ec215adb16ba735a98..cd67af66328185f767268c0404706636f00c101a 100644
--- a/ui/events/ozone/evdev/event_factory_evdev.cc
+++ b/ui/events/ozone/evdev/event_factory_evdev.cc
@@ -196,6 +196,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());
@@ -218,6 +225,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_) {
« no previous file with comments | « ui/events/ozone/evdev/event_factory_evdev.h ('k') | ui/events/ozone/event_factory_ozone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698