| 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/x/device_list_cache_x.h" | 5 #include "ui/events/x/device_list_cache_x.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" |
| 11 #include "ui/events/x/device_data_manager_x11.h" | 11 #include "ui/events/x/device_data_manager_x11.h" |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 bool IsXI2Available() { | 15 bool IsXI2Available() { |
| 16 #if defined(USE_AURA) | |
| 17 return ui::DeviceDataManagerX11::GetInstance()->IsXInput2Available(); | |
| 18 #else | |
| 19 return false; | 16 return false; |
| 20 #endif | |
| 21 } | 17 } |
| 22 | 18 |
| 23 } | 19 } |
| 24 | 20 |
| 25 namespace ui { | 21 namespace ui { |
| 26 | 22 |
| 27 DeviceListCacheX::DeviceListCacheX() { | 23 DeviceListCacheX::DeviceListCacheX() { |
| 28 } | 24 } |
| 29 | 25 |
| 30 DeviceListCacheX::~DeviceListCacheX() { | 26 DeviceListCacheX::~DeviceListCacheX() { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 XIDeviceList& xi_dev_list = xi_dev_list_map_[display]; | 65 XIDeviceList& xi_dev_list = xi_dev_list_map_[display]; |
| 70 if (!xi_dev_list.devices && !xi_dev_list.count) { | 66 if (!xi_dev_list.devices && !xi_dev_list.count) { |
| 71 xi_dev_list.devices = XIQueryDevice(display, XIAllDevices, | 67 xi_dev_list.devices = XIQueryDevice(display, XIAllDevices, |
| 72 &xi_dev_list.count); | 68 &xi_dev_list.count); |
| 73 } | 69 } |
| 74 return xi_dev_list; | 70 return xi_dev_list; |
| 75 } | 71 } |
| 76 | 72 |
| 77 } // namespace ui | 73 } // namespace ui |
| 78 | 74 |
| OLD | NEW |