| 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/device_list_cache_x11.h" | 5 #include "ui/events/devices/x11/device_list_cache_x11.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 namespace ui { | 25 namespace ui { |
| 26 | 26 |
| 27 DeviceListCacheX11::DeviceListCacheX11() { | 27 DeviceListCacheX11::DeviceListCacheX11() { |
| 28 } | 28 } |
| 29 | 29 |
| 30 DeviceListCacheX11::~DeviceListCacheX11() { | 30 DeviceListCacheX11::~DeviceListCacheX11() { |
| 31 } | 31 } |
| 32 | 32 |
| 33 DeviceListCacheX11* DeviceListCacheX11::GetInstance() { | 33 DeviceListCacheX11* DeviceListCacheX11::GetInstance() { |
| 34 return Singleton<DeviceListCacheX11>::get(); | 34 return base::Singleton<DeviceListCacheX11>::get(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void DeviceListCacheX11::UpdateDeviceList(Display* display) { | 37 void DeviceListCacheX11::UpdateDeviceList(Display* display) { |
| 38 XDeviceList& new_x_dev_list = x_dev_list_; | 38 XDeviceList& new_x_dev_list = x_dev_list_; |
| 39 new_x_dev_list.devices.reset( | 39 new_x_dev_list.devices.reset( |
| 40 XListInputDevices(display, &new_x_dev_list.count)); | 40 XListInputDevices(display, &new_x_dev_list.count)); |
| 41 | 41 |
| 42 XIDeviceList& new_xi_dev_list = xi_dev_list_; | 42 XIDeviceList& new_xi_dev_list = xi_dev_list_; |
| 43 new_xi_dev_list.devices.reset( | 43 new_xi_dev_list.devices.reset( |
| 44 IsXI2Available() | 44 IsXI2Available() |
| (...skipping 13 matching lines...) Expand all Loading... |
| 58 XIDeviceList& xi_dev_list = xi_dev_list_; | 58 XIDeviceList& xi_dev_list = xi_dev_list_; |
| 59 if (!xi_dev_list.devices && !xi_dev_list.count) { | 59 if (!xi_dev_list.devices && !xi_dev_list.count) { |
| 60 xi_dev_list.devices.reset( | 60 xi_dev_list.devices.reset( |
| 61 XIQueryDevice(display, XIAllDevices, &xi_dev_list.count)); | 61 XIQueryDevice(display, XIAllDevices, &xi_dev_list.count)); |
| 62 } | 62 } |
| 63 return xi_dev_list; | 63 return xi_dev_list; |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace ui | 66 } // namespace ui |
| 67 | 67 |
| OLD | NEW |