| 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
|
|
|