OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/events/ozone/evdev/libgestures_glue/gesture_property_provider.h" | 5 #include "ui/events/ozone/evdev/libgestures_glue/gesture_property_provider.h" |
6 | 6 |
7 #include <gestures/gestures.h> | 7 #include <gestures/gestures.h> |
8 #include <libevdev/libevdev.h> | 8 #include <libevdev/libevdev.h> |
9 | 9 |
10 #include <fnmatch.h> | 10 #include <fnmatch.h> |
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 for (; it != device_map_.end(); ++it) { | 857 for (; it != device_map_.end(); ++it) { |
858 if (IsDeviceOfType(it->second, type)) { | 858 if (IsDeviceOfType(it->second, type)) { |
859 exists = true; | 859 exists = true; |
860 if (device_ids) | 860 if (device_ids) |
861 device_ids->push_back(it->first); | 861 device_ids->push_back(it->first); |
862 } | 862 } |
863 } | 863 } |
864 return exists; | 864 return exists; |
865 } | 865 } |
866 | 866 |
| 867 bool GesturePropertyProvider::IsDeviceIdOfType(const DeviceId device_id, |
| 868 const EventDeviceType type) { |
| 869 DeviceMap::const_iterator it = device_map_.find(device_id); |
| 870 if (it == device_map_.end()) |
| 871 return false; |
| 872 return IsDeviceOfType(it->second, type); |
| 873 } |
| 874 |
867 GesturesProp* GesturePropertyProvider::GetProperty(const DeviceId device_id, | 875 GesturesProp* GesturePropertyProvider::GetProperty(const DeviceId device_id, |
868 const std::string& name) { | 876 const std::string& name) { |
869 return FindProperty(device_id, name); | 877 return FindProperty(device_id, name); |
870 } | 878 } |
871 | 879 |
872 void GesturePropertyProvider::RegisterDevice(const DeviceId id, | 880 void GesturePropertyProvider::RegisterDevice(const DeviceId id, |
873 const DevicePtr device) { | 881 const DevicePtr device) { |
874 DeviceMap::const_iterator it = device_map_.find(id); | 882 DeviceMap::const_iterator it = device_map_.find(id); |
875 if (it != device_map_.end()) | 883 if (it != device_map_.end()) |
876 return; | 884 return; |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1492 const GesturesPropProvider kGesturePropProvider = { | 1500 const GesturesPropProvider kGesturePropProvider = { |
1493 GesturesPropFunctionsWrapper::CreateInt, | 1501 GesturesPropFunctionsWrapper::CreateInt, |
1494 GesturesPropFunctionsWrapper::CreateShort, | 1502 GesturesPropFunctionsWrapper::CreateShort, |
1495 GesturesPropFunctionsWrapper::CreateBool, | 1503 GesturesPropFunctionsWrapper::CreateBool, |
1496 GesturesPropFunctionsWrapper::CreateString, | 1504 GesturesPropFunctionsWrapper::CreateString, |
1497 GesturesPropFunctionsWrapper::CreateReal, | 1505 GesturesPropFunctionsWrapper::CreateReal, |
1498 GesturesPropFunctionsWrapper::RegisterHandlers, | 1506 GesturesPropFunctionsWrapper::RegisterHandlers, |
1499 GesturesPropFunctionsWrapper::Free}; | 1507 GesturesPropFunctionsWrapper::Free}; |
1500 | 1508 |
1501 } // namespace ui | 1509 } // namespace ui |
OLD | NEW |