Chromium Code Reviews| Index: ui/events/input_device.h |
| diff --git a/ui/events/input_device.h b/ui/events/input_device.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3dcf4e9a070fc4f7b18cb2b329083ba1e21d3383 |
| --- /dev/null |
| +++ b/ui/events/input_device.h |
| @@ -0,0 +1,38 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef UI_EVENTS_INPUT_DEVICE_H_ |
| +#define UI_EVENTS_INPUT_DEVICE_H_ |
| + |
| +#include <string> |
| + |
| +#include "ui/events/events_base_export.h" |
| + |
| +namespace ui { |
| + |
| +enum InputDeviceType { |
| + INTERNAL, // Internal device. |
|
sky
2014/10/20 22:18:44
It's not clear what internal or external mean in t
sky
2014/10/20 22:18:44
Prefix with enum name, eg INPUT_DEVICE_INTERNAL.
|
| + EXTERNAL, // Known external device. |
| + UNKNOWN, // Device that may or may not be an external device. |
| +}; |
| + |
| +// Represents an input device state. |
| +struct EVENTS_BASE_EXPORT InputDevice { |
| + static const int kInvalidId; |
| + |
| + InputDevice(int id, InputDeviceType type, const std::string& name); |
| + |
|
sky
2014/10/20 22:18:44
Don't you need a virtual destructor?
|
| + // ID of the device. This ID must uniquely identify the input device. |
| + int id; |
| + |
| + // The type of the input device. |
| + InputDeviceType type; |
| + |
| + // Name of the device. |
| + std::string name; |
| +}; |
| + |
| +} // namespace ui |
| + |
| +#endif // UI_EVENTS_INPUT_DEVICE_H_ |