| 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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 return false; | 503 return false; |
| 504 } | 504 } |
| 505 | 505 |
| 506 // Check if a match criteria is a device type one. | 506 // Check if a match criteria is a device type one. |
| 507 bool IsMatchDeviceType(const std::string& match_type) { | 507 bool IsMatchDeviceType(const std::string& match_type) { |
| 508 return StartsWithASCII(match_type, "MatchIs", true); | 508 return StartsWithASCII(match_type, "MatchIs", true); |
| 509 } | 509 } |
| 510 | 510 |
| 511 // Parse a boolean value keyword (e.g., on/off, true/false). | 511 // Parse a boolean value keyword (e.g., on/off, true/false). |
| 512 int ParseBooleanKeyword(const std::string& value) { | 512 int ParseBooleanKeyword(const std::string& value) { |
| 513 for (size_t i = 0; i < arraysize(kTrue); ++i) | 513 for (size_t i = 0; i < arraysize(kTrue); ++i) { |
| 514 if (LowerCaseEqualsASCII(value, kTrue[i])) | 514 if (base::LowerCaseEqualsASCII(value, kTrue[i])) |
| 515 return 1; | 515 return 1; |
| 516 for (size_t i = 0; i < arraysize(kFalse); ++i) | 516 } |
| 517 if (LowerCaseEqualsASCII(value, kFalse[i])) | 517 for (size_t i = 0; i < arraysize(kFalse); ++i) { |
| 518 if (base::LowerCaseEqualsASCII(value, kFalse[i])) |
| 518 return -1; | 519 return -1; |
| 520 } |
| 519 return 0; | 521 return 0; |
| 520 } | 522 } |
| 521 | 523 |
| 522 // Log the value of an array property. | 524 // Log the value of an array property. |
| 523 template <typename T> | 525 template <typename T> |
| 524 void LogArrayProperty(std::ostream& os, const std::vector<T>& value) { | 526 void LogArrayProperty(std::ostream& os, const std::vector<T>& value) { |
| 525 os << "("; | 527 os << "("; |
| 526 for (size_t i = 0; i < value.size(); ++i) { | 528 for (size_t i = 0; i < value.size(); ++i) { |
| 527 if (i > 0) | 529 if (i > 0) |
| 528 os << ", "; | 530 os << ", "; |
| (...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1539 const GesturesPropProvider kGesturePropProvider = { | 1541 const GesturesPropProvider kGesturePropProvider = { |
| 1540 GesturesPropFunctionsWrapper::CreateInt, | 1542 GesturesPropFunctionsWrapper::CreateInt, |
| 1541 GesturesPropFunctionsWrapper::CreateShort, | 1543 GesturesPropFunctionsWrapper::CreateShort, |
| 1542 GesturesPropFunctionsWrapper::CreateBool, | 1544 GesturesPropFunctionsWrapper::CreateBool, |
| 1543 GesturesPropFunctionsWrapper::CreateString, | 1545 GesturesPropFunctionsWrapper::CreateString, |
| 1544 GesturesPropFunctionsWrapper::CreateReal, | 1546 GesturesPropFunctionsWrapper::CreateReal, |
| 1545 GesturesPropFunctionsWrapper::RegisterHandlers, | 1547 GesturesPropFunctionsWrapper::RegisterHandlers, |
| 1546 GesturesPropFunctionsWrapper::Free}; | 1548 GesturesPropFunctionsWrapper::Free}; |
| 1547 | 1549 |
| 1548 } // namespace ui | 1550 } // namespace ui |
| OLD | NEW |