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

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

Issue 230883005: ozone: evdev: Filter devices by path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/device_manager_udev.cc
diff --git a/ui/events/ozone/evdev/device_manager_udev.cc b/ui/events/ozone/evdev/device_manager_udev.cc
index de7b29dff71cc3f718fdc23f4c0cae1de43245ff..f08a0b0858b57ef287cbff01bfda0cf797b518a1 100644
--- a/ui/events/ozone/evdev/device_manager_udev.cc
+++ b/ui/events/ozone/evdev/device_manager_udev.cc
@@ -10,6 +10,7 @@
#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_pump_ozone.h"
+#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "ui/events/ozone/evdev/device_manager_evdev.h"
#include "ui/events/ozone/evdev/event_factory_evdev.h"
@@ -101,6 +102,10 @@ bool UdevEnumerateInputDevices(struct udev* udev,
if (!path)
continue;
+ // Filter non-evdev device notes.
+ if (!StartsWithASCII(path, "/dev/input/event", true))
+ continue;
+
// Found input device node; attach.
device_callback.Run(base::FilePath(path));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698