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

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

Issue 63443002: Revert 233414 "x11: Move XInput2 availability information out of..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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 | « trunk/src/ui/events/x/device_list_cache_x.h ('k') | trunk/src/ui/events/x/touch_factory_x11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « trunk/src/ui/events/x/device_list_cache_x.h ('k') | trunk/src/ui/events/x/touch_factory_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698