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

Unified Diff: ui/events/devices/x11/touch_factory_x11.cc

Issue 1272823003: Update SplitString calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/ime/input_method_auralinux_unittest.cc ('k') | ui/events/ozone/evdev/event_device_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/devices/x11/touch_factory_x11.cc
diff --git a/ui/events/devices/x11/touch_factory_x11.cc b/ui/events/devices/x11/touch_factory_x11.cc
index 322934447348528a0161496b8405bbd265d2cd6e..3fa15c80df9671d5d2ec0809265ee08cf45ad011 100644
--- a/ui/events/devices/x11/touch_factory_x11.cc
+++ b/ui/events/devices/x11/touch_factory_x11.cc
@@ -62,16 +62,15 @@ void TouchFactory::SetTouchDeviceListFromCommandLine() {
switches::kTouchDevices);
if (!touch_devices.empty()) {
- std::vector<std::string> devs;
std::vector<int> device_ids;
- int devid;
- base::SplitString(touch_devices, ',', &devs);
- for (std::vector<std::string>::iterator iter = devs.begin();
- iter != devs.end(); ++iter) {
- if (base::StringToInt(*iter, reinterpret_cast<int*>(&devid)))
+ for (const base::StringPiece& dev :
+ base::SplitStringPiece(touch_devices, ",", base::TRIM_WHITESPACE,
+ base::SPLIT_WANT_ALL)) {
+ int devid;
+ if (base::StringToInt(dev, &devid))
device_ids.push_back(devid);
else
- DLOG(WARNING) << "Invalid touch-device id: " << *iter;
+ DLOG(WARNING) << "Invalid touch-device id: " << dev.as_string();
}
ui::TouchFactory::GetInstance()->SetTouchDeviceList(device_ids);
}
« no previous file with comments | « ui/base/ime/input_method_auralinux_unittest.cc ('k') | ui/events/ozone/evdev/event_device_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698