Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Side by Side Diff: ui/events/ozone/evdev/libgestures_glue/gesture_property_provider.cc

Issue 1274123003: Update SplitString calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no media changes Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/events/ozone/evdev/event_device_test_util.cc ('k') | ui/gfx/font_fallback_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 return false; 759 return false;
760 } 760 }
761 761
762 MatchUSBID::MatchUSBID(const std::string& arg) : MatchCriteria(arg) { 762 MatchUSBID::MatchUSBID(const std::string& arg) : MatchCriteria(arg) {
763 // Check each pattern and split valid ones into vids and pids. 763 // Check each pattern and split valid ones into vids and pids.
764 for (size_t i = 0; i < args_.size(); ++i) { 764 for (size_t i = 0; i < args_.size(); ++i) {
765 if (!IsValidPattern(args_[i])) { 765 if (!IsValidPattern(args_[i])) {
766 LOG(ERROR) << "Invalid USB ID: " << args_[i]; 766 LOG(ERROR) << "Invalid USB ID: " << args_[i];
767 continue; 767 continue;
768 } 768 }
769 std::vector<std::string> tokens; 769 std::vector<std::string> tokens = base::SplitString(
770 base::SplitString(args_[i], ':', &tokens); 770 args_[i], ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
771 vid_patterns_.push_back(base::StringToLowerASCII(tokens[0])); 771 vid_patterns_.push_back(base::StringToLowerASCII(tokens[0]));
772 pid_patterns_.push_back(base::StringToLowerASCII(tokens[1])); 772 pid_patterns_.push_back(base::StringToLowerASCII(tokens[1]));
773 } 773 }
774 if (vid_patterns_.empty()) { 774 if (vid_patterns_.empty()) {
775 LOG(ERROR) << "No valid USB ID pattern found, will be ignored: \"" << arg 775 LOG(ERROR) << "No valid USB ID pattern found, will be ignored: \"" << arg
776 << "\""; 776 << "\"";
777 } 777 }
778 } 778 }
779 779
780 bool MatchUSBID::Match(const DevicePtr device) { 780 bool MatchUSBID::Match(const DevicePtr device) {
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
1542 const GesturesPropProvider kGesturePropProvider = { 1542 const GesturesPropProvider kGesturePropProvider = {
1543 GesturesPropFunctionsWrapper::CreateInt, 1543 GesturesPropFunctionsWrapper::CreateInt,
1544 GesturesPropFunctionsWrapper::CreateShort, 1544 GesturesPropFunctionsWrapper::CreateShort,
1545 GesturesPropFunctionsWrapper::CreateBool, 1545 GesturesPropFunctionsWrapper::CreateBool,
1546 GesturesPropFunctionsWrapper::CreateString, 1546 GesturesPropFunctionsWrapper::CreateString,
1547 GesturesPropFunctionsWrapper::CreateReal, 1547 GesturesPropFunctionsWrapper::CreateReal,
1548 GesturesPropFunctionsWrapper::RegisterHandlers, 1548 GesturesPropFunctionsWrapper::RegisterHandlers,
1549 GesturesPropFunctionsWrapper::Free}; 1549 GesturesPropFunctionsWrapper::Free};
1550 1550
1551 } // namespace ui 1551 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/event_device_test_util.cc ('k') | ui/gfx/font_fallback_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698