Chromium Code Reviews| Index: ui/events/ozone/evdev/libgestures_glue/gesture_property_provider.cc |
| diff --git a/ui/events/ozone/evdev/libgestures_glue/gesture_property_provider.cc b/ui/events/ozone/evdev/libgestures_glue/gesture_property_provider.cc |
| index 76100b6124e99ca18761b9181ec1d190168c5463..1392ef749dfccab92da390f86d3d25a265512e0f 100644 |
| --- a/ui/events/ozone/evdev/libgestures_glue/gesture_property_provider.cc |
| +++ b/ui/events/ozone/evdev/libgestures_glue/gesture_property_provider.cc |
| @@ -877,6 +877,30 @@ GesturesProp* GesturePropertyProvider::GetProperty(const DeviceId device_id, |
| return FindProperty(device_id, name); |
| } |
| +std::vector<std::string> GesturePropertyProvider::GetPropertyNamesById( |
| + const DeviceId device_id) { |
| + internal::GestureDevicePropertyData* device_data = |
| + device_data_map_.get(device_id); |
| + if (!device_data) |
| + return std::vector<std::string>(); |
| + |
| + // Dump all property names of the device. |
| + std::vector<std::string> names; |
| + internal::ScopedPropertiesMap::const_iterator it = |
|
achuithb
2015/01/22 20:42:12
Move this to the initializer of the for loop below
Shecky Lin
2015/01/23 07:46:46
Done.
|
| + device_data->properties.begin(); |
| + for (; it != device_data->properties.end(); ++it) |
| + names.push_back(it->first); |
| + return names; |
| +} |
| + |
| +std::string GesturePropertyProvider::GetDeviceNameById( |
| + const DeviceId device_id) { |
| + DeviceMap::const_iterator it = device_map_.find(device_id); |
| + if (it == device_map_.end()) |
| + return std::string(); |
| + return std::string(it->second->info.name); |
| +} |
| + |
| void GesturePropertyProvider::RegisterDevice(const DeviceId id, |
| const DevicePtr device) { |
| DeviceMap::const_iterator it = device_map_.find(id); |