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

Unified Diff: ui/events/devices/input_device.cc

Issue 1992443002: Add Mojo IPC based input-device service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup_ddm
Patch Set: Clean up/move files. Created 4 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/devices/input_device.cc
diff --git a/ui/events/devices/input_device.cc b/ui/events/devices/input_device.cc
index 4734edd0280986dc11f231b3a65394e6db004d4b..e6af29db3aa98715d09cad90a2fb7c5a8fe4dfba 100644
--- a/ui/events/devices/input_device.cc
+++ b/ui/events/devices/input_device.cc
@@ -6,8 +6,26 @@
#include <string>
+#include "base/strings/stringprintf.h"
+
namespace ui {
+namespace {
+
+std::string InputDeviceTypeString(InputDeviceType type) {
+#define ECASE(value) \
+ case value: \
+ return #value
+ switch (type) {
+ ECASE(INPUT_DEVICE_INTERNAL);
+ ECASE(INPUT_DEVICE_EXTERNAL);
+ ECASE(INPUT_DEVICE_UNKNOWN);
+ }
+#undef ECASE
+}
+
+} // namespace
+
// static
const int InputDevice::kInvalidId = 0;
@@ -37,4 +55,10 @@ InputDevice::InputDevice(const InputDevice& other) = default;
InputDevice::~InputDevice() {
}
+std::string InputDevice::ToString() const {
+ return base::StringPrintf("InputDevice[id=%d, name=%s, sys_path=%s, type=%s]",
+ id, name.c_str(), sys_path.MaybeAsASCII().c_str(),
+ InputDeviceTypeString(type).c_str());
+}
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698