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 3fa15c80df9671d5d2ec0809265ee08cf45ad011..322934447348528a0161496b8405bbd265d2cd6e 100644 |
--- a/ui/events/devices/x11/touch_factory_x11.cc |
+++ b/ui/events/devices/x11/touch_factory_x11.cc |
@@ -62,15 +62,16 @@ |
switches::kTouchDevices); |
if (!touch_devices.empty()) { |
+ std::vector<std::string> devs; |
std::vector<int> device_ids; |
- for (const base::StringPiece& dev : |
- base::SplitStringPiece(touch_devices, ",", base::TRIM_WHITESPACE, |
- base::SPLIT_WANT_ALL)) { |
- int devid; |
- if (base::StringToInt(dev, &devid)) |
+ 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))) |
device_ids.push_back(devid); |
else |
- DLOG(WARNING) << "Invalid touch-device id: " << dev.as_string(); |
+ DLOG(WARNING) << "Invalid touch-device id: " << *iter; |
} |
ui::TouchFactory::GetInstance()->SetTouchDeviceList(device_ids); |
} |