OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/devices/x11/touch_factory_x11.h" | 5 #include "ui/events/devices/x11/touch_factory_x11.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <X11/Xatom.h> | 8 #include <X11/Xatom.h> |
9 #include <X11/cursorfont.h> | 9 #include <X11/cursorfont.h> |
10 #include <X11/extensions/XInput.h> | 10 #include <X11/extensions/XInput.h> |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 | 329 |
330 void TouchFactory::SetTouchscreensEnabled(bool enabled) { | 330 void TouchFactory::SetTouchscreensEnabled(bool enabled) { |
331 touch_screens_enabled_ = enabled; | 331 touch_screens_enabled_ = enabled; |
332 DeviceDataManager::GetInstance()->SetTouchscreensEnabled(enabled); | 332 DeviceDataManager::GetInstance()->SetTouchscreensEnabled(enabled); |
333 } | 333 } |
334 | 334 |
335 void TouchFactory::CacheTouchscreenIds(int device_id) { | 335 void TouchFactory::CacheTouchscreenIds(int device_id) { |
336 if (!DeviceDataManager::HasInstance()) | 336 if (!DeviceDataManager::HasInstance()) |
337 return; | 337 return; |
338 std::vector<TouchscreenDevice> touchscreens = | 338 std::vector<TouchscreenDevice> touchscreens = |
339 DeviceDataManager::GetInstance()->touchscreen_devices(); | 339 DeviceDataManager::GetInstance()->GetTouchscreenDevices(); |
340 const auto it = | 340 const auto it = |
341 std::find_if(touchscreens.begin(), touchscreens.end(), | 341 std::find_if(touchscreens.begin(), touchscreens.end(), |
342 [device_id](const TouchscreenDevice& touchscreen) { | 342 [device_id](const TouchscreenDevice& touchscreen) { |
343 return touchscreen.id == device_id; | 343 return touchscreen.id == device_id; |
344 }); | 344 }); |
345 // Internal displays will have a vid and pid of 0. Ignore them. | 345 // Internal displays will have a vid and pid of 0. Ignore them. |
346 if (it != touchscreens.end() && it->vendor_id && it->product_id) | 346 if (it != touchscreens.end() && it->vendor_id && it->product_id) |
347 touchscreen_ids_.insert(std::make_pair(it->vendor_id, it->product_id)); | 347 touchscreen_ids_.insert(std::make_pair(it->vendor_id, it->product_id)); |
348 } | 348 } |
349 | 349 |
350 } // namespace ui | 350 } // namespace ui |
OLD | NEW |