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

Unified Diff: ui/events/platform/x11/device_list_cache_x.cc

Issue 1287103004: Sync ui/events to chromium @ https://codereview.chromium.org/1210203002 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 4 months 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/platform/x11/device_list_cache_x.h ('k') | ui/events/platform/x11/hotplug_event_handler_x11.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/platform/x11/device_list_cache_x.cc
diff --git a/ui/events/platform/x11/device_list_cache_x.cc b/ui/events/platform/x11/device_list_cache_x.cc
deleted file mode 100644
index c2ec94dce6e0c396fbe1c3b8104e98650997d9b2..0000000000000000000000000000000000000000
--- a/ui/events/platform/x11/device_list_cache_x.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/events/platform/x11/device_list_cache_x.h"
-
-#include <algorithm>
-
-#include "base/memory/singleton.h"
-#include "base/message_loop/message_loop.h"
-#include "ui/events/platform/x11/device_data_manager_x11.h"
-
-namespace {
-
-bool IsXI2Available() {
- return false;
-}
-}
-
-namespace ui {
-
-DeviceListCacheX::DeviceListCacheX() {
-}
-
-DeviceListCacheX::~DeviceListCacheX() {
- std::map<Display*, XDeviceList>::iterator xp;
- for (xp = x_dev_list_map_.begin(); xp != x_dev_list_map_.end(); xp++) {
- if (xp->second.devices)
- XFreeDeviceList(xp->second.devices);
- }
- std::map<Display*, XIDeviceList>::iterator xip;
- for (xip = xi_dev_list_map_.begin(); xip != xi_dev_list_map_.end(); xip++) {
- if (xip->second.devices)
- XIFreeDeviceInfo(xip->second.devices);
- }
-}
-
-DeviceListCacheX* DeviceListCacheX::GetInstance() {
- return Singleton<DeviceListCacheX>::get();
-}
-
-void DeviceListCacheX::UpdateDeviceList(Display* display) {
- XDeviceList& new_x_dev_list = x_dev_list_map_[display];
- if (new_x_dev_list.devices)
- XFreeDeviceList(new_x_dev_list.devices);
- new_x_dev_list.devices = XListInputDevices(display, &new_x_dev_list.count);
-
- 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;
-}
-
-const XDeviceList& DeviceListCacheX::GetXDeviceList(Display* display) {
- XDeviceList& x_dev_list = x_dev_list_map_[display];
- // Note that the function can be called before any update has taken place.
- if (!x_dev_list.devices && !x_dev_list.count)
- x_dev_list.devices = XListInputDevices(display, &x_dev_list.count);
- return x_dev_list;
-}
-
-const XIDeviceList& DeviceListCacheX::GetXI2DeviceList(Display* display) {
- XIDeviceList& xi_dev_list = xi_dev_list_map_[display];
- if (!xi_dev_list.devices && !xi_dev_list.count) {
- xi_dev_list.devices =
- XIQueryDevice(display, XIAllDevices, &xi_dev_list.count);
- }
- return xi_dev_list;
-}
-
-} // namespace ui
« no previous file with comments | « ui/events/platform/x11/device_list_cache_x.h ('k') | ui/events/platform/x11/hotplug_event_handler_x11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698