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

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: Rebase/move. 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..aeac8a5eaa01185f82c242d81dc994162d2d16e2 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,9 @@ InputDevice::InputDevice(const InputDevice& other) = default;
InputDevice::~InputDevice() {
}
+std::string InputDevice::ToString() const {
+ return base::StringPrintf("InputDevice[id=%d, name=\"%s\", type=%s]", id,
+ name.c_str(), InputDeviceTypeString(type).c_str());
+}
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698