| Index: trunk/src/ui/events/x/device_list_cache_x.cc
|
| ===================================================================
|
| --- trunk/src/ui/events/x/device_list_cache_x.cc (revision 233415)
|
| +++ trunk/src/ui/events/x/device_list_cache_x.cc (working copy)
|
| @@ -8,13 +8,12 @@
|
|
|
| #include "base/memory/singleton.h"
|
| #include "base/message_loop/message_loop.h"
|
| -#include "ui/events/x/device_data_manager.h"
|
|
|
| namespace {
|
|
|
| bool IsXI2Available() {
|
| #if defined(USE_AURA)
|
| - return ui::DeviceDataManager::GetInstance()->IsXInput2Available();
|
| + return base::MessagePumpForUI::HasXInput2();
|
| #else
|
| return false;
|
| #endif
|
| @@ -24,7 +23,8 @@
|
|
|
| namespace ui {
|
|
|
| -DeviceListCacheX::DeviceListCacheX() {
|
| +DeviceListCacheX::DeviceListCacheX()
|
| + : xi2_(IsXI2Available()) {
|
| }
|
|
|
| DeviceListCacheX::~DeviceListCacheX() {
|
| @@ -53,8 +53,8 @@
|
| XIDeviceList& new_xi_dev_list = xi_dev_list_map_[display];
|
| if (new_xi_dev_list.devices)
|
| XIFreeDeviceInfo(new_xi_dev_list.devices);
|
| - new_xi_dev_list.devices = IsXI2Available() ?
|
| - XIQueryDevice(display, XIAllDevices, &new_xi_dev_list.count) : NULL;
|
| + new_xi_dev_list.devices = xi2_ ? XIQueryDevice(display, XIAllDevices,
|
| + &new_xi_dev_list.count) : NULL;
|
| }
|
|
|
| const XDeviceList& DeviceListCacheX::GetXDeviceList(Display* display) {
|
| @@ -67,7 +67,7 @@
|
|
|
| const XIDeviceList& DeviceListCacheX::GetXI2DeviceList(Display* display) {
|
| XIDeviceList& xi_dev_list = xi_dev_list_map_[display];
|
| - if (!xi_dev_list.devices && !xi_dev_list.count) {
|
| + if (xi2_ && !xi_dev_list.devices && !xi_dev_list.count) {
|
| xi_dev_list.devices = XIQueryDevice(display, XIAllDevices,
|
| &xi_dev_list.count);
|
| }
|
|
|