Index: ui/base/touch/touch_factory.cc |
diff --git a/ui/base/touch/touch_factory.cc b/ui/base/touch/touch_factory.cc |
index b636ea05d7b444ccd651ee73b1a47fc592391a51..8aeb71136a21ba7224c0d34844a96d3c8d6bceb3 100644 |
--- a/ui/base/touch/touch_factory.cc |
+++ b/ui/base/touch/touch_factory.cc |
@@ -64,8 +64,8 @@ XIValuatorClassInfo* FindTPValuator(Display* display, |
reinterpret_cast<XIValuatorClassInfo*>(info->classes[i]); |
if (v->label) { |
- const char* atom = XGetAtomName(display, v->label); |
- if (atom && strcmp(atom, atom_tp) == 0) |
+ ui::XScopedString atom(XGetAtomName(display, v->label)); |
+ if (atom.string() && strcmp(atom.string(), atom_tp) == 0) |
return v; |
} |
} |
@@ -151,8 +151,8 @@ void TouchFactory::UpdateDeviceList(Display* display) { |
XDeviceInfo* devlist = XListInputDevices(display, &count); |
for (int i = 0; i < count; i++) { |
if (devlist[i].type) { |
- const char* devtype = XGetAtomName(display, devlist[i].type); |
- if (devtype && !strcmp(devtype, XI_TOUCHSCREEN)) { |
+ XScopedString devtype(XGetAtomName(display, devlist[i].type)); |
+ if (devtype.string() && !strcmp(devtype.string(), XI_TOUCHSCREEN)) { |
touch_device_lookup_[devlist[i].id] = true; |
touch_device_list_[devlist[i].id] = true; |
touch_device_available_ = true; |