Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Unified Diff: ui/events/x/device_list_cache_x.cc

Issue 52823002: x11: Move XInput2 availability information out of the message pump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/x/device_list_cache_x.h ('k') | ui/events/x/touch_factory_x11.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/x/device_list_cache_x.cc
diff --git a/ui/events/x/device_list_cache_x.cc b/ui/events/x/device_list_cache_x.cc
index e2eb5ee354078145cf3acb2d8df804c18ad71c01..266ee6acf772c964c60028edda40c7a7f307708e 100644
--- a/ui/events/x/device_list_cache_x.cc
+++ b/ui/events/x/device_list_cache_x.cc
@@ -8,12 +8,13 @@
#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 base::MessagePumpForUI::HasXInput2();
+ return ui::DeviceDataManager::GetInstance()->IsXInput2Available();
#else
return false;
#endif
@@ -23,8 +24,7 @@ bool IsXI2Available() {
namespace ui {
-DeviceListCacheX::DeviceListCacheX()
- : xi2_(IsXI2Available()) {
+DeviceListCacheX::DeviceListCacheX() {
}
DeviceListCacheX::~DeviceListCacheX() {
@@ -53,8 +53,8 @@ void DeviceListCacheX::UpdateDeviceList(Display* display) {
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 = xi2_ ? XIQueryDevice(display, XIAllDevices,
- &new_xi_dev_list.count) : NULL;
+ new_xi_dev_list.devices = IsXI2Available() ?
+ XIQueryDevice(display, XIAllDevices, &new_xi_dev_list.count) : NULL;
}
const XDeviceList& DeviceListCacheX::GetXDeviceList(Display* display) {
@@ -67,7 +67,7 @@ const XDeviceList& DeviceListCacheX::GetXDeviceList(Display* display) {
const XIDeviceList& DeviceListCacheX::GetXI2DeviceList(Display* display) {
XIDeviceList& xi_dev_list = xi_dev_list_map_[display];
- if (xi2_ && !xi_dev_list.devices && !xi_dev_list.count) {
+ if (!xi_dev_list.devices && !xi_dev_list.count) {
xi_dev_list.devices = XIQueryDevice(display, XIAllDevices,
&xi_dev_list.count);
}
« no previous file with comments | « ui/events/x/device_list_cache_x.h ('k') | ui/events/x/touch_factory_x11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698