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

Unified Diff: ui/events/x/device_data_manager_x11.h

Issue 289283015: Extract touchscreen device management into a generic manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 7 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
Index: ui/events/x/device_data_manager_x11.h
diff --git a/ui/events/x/device_data_manager.h b/ui/events/x/device_data_manager_x11.h
similarity index 91%
rename from ui/events/x/device_data_manager.h
rename to ui/events/x/device_data_manager_x11.h
index 1135ec222b89ee5d491f5fae7e130aced0c64bc2..4bbc4bd39943ff90ca88c70c13ea006f62442e7c 100644
--- a/ui/events/x/device_data_manager.h
+++ b/ui/events/x/device_data_manager_x11.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_EVENTS_X_DEVICE_DATA_MANAGER_H_
-#define UI_EVENTS_X_DEVICE_DATA_MANAGER_H_
+#ifndef UI_EVENTS_X_DEVICE_DATA_MANAGER_X11_H_
+#define UI_EVENTS_X_DEVICE_DATA_MANAGER_X11_H_
// Generically-named #defines from Xlib is conflicting with symbols in GTest.
// So many tests .cc file #undef Bool before including device_data_manager.h,
@@ -21,11 +21,11 @@
#include "base/basictypes.h"
#include "base/event_types.h"
#include "base/memory/scoped_ptr.h"
+#include "ui/events/device_data_manager.h"
#include "ui/events/event.h"
#include "ui/events/event_constants.h"
#include "ui/events/events_base_export.h"
#include "ui/gfx/geometry/rect.h"
-#include "ui/gfx/transform.h"
#include "ui/gfx/x/x11_atom_cache.h"
template <typename T> struct DefaultSingletonTraits;
@@ -42,7 +42,7 @@ enum GestureMetricsType {
// A class that extracts and tracks the input events data. It currently handles
// mouse, touchpad and touchscreen devices.
-class EVENTS_BASE_EXPORT DeviceDataManager {
+class EVENTS_BASE_EXPORT DeviceDataManagerX11 : public DeviceDataManager {
public:
// Enumerate additional data that one might be interested on an input event,
// which are usually wrapped in X valuators. If you modify any of this,
@@ -106,7 +106,7 @@ class EVENTS_BASE_EXPORT DeviceDataManager {
static bool IsTouchDataType(const int type);
// Returns the DeviceDataManager singleton.
- static DeviceDataManager* GetInstance();
+ static DeviceDataManagerX11* GetInstance();
// Returns if XInput2 is available on the system.
bool IsXInput2Available() const;
@@ -221,20 +221,13 @@ class EVENTS_BASE_EXPORT DeviceDataManager {
DataType type,
double value);
- void ClearTouchTransformerRecord();
- void UpdateTouchInfoForDisplay(int64 display_id,
- int touch_device_id,
- const gfx::Transform& touch_transformer);
- void ApplyTouchTransformer(int touch_device_id, float* x, float* y);
- int64 GetDisplayForTouchDevice(int touch_device_id) const;
bool TouchEventNeedsCalibrate(int touch_device_id) const;
private:
- // Requirement for Singleton.
- friend struct DefaultSingletonTraits<DeviceDataManager>;
+ friend struct DefaultSingletonTraits<DeviceDataManagerX11>;
- DeviceDataManager();
- ~DeviceDataManager();
+ DeviceDataManagerX11();
+ virtual ~DeviceDataManagerX11();
// Initialize the XInput related system information.
bool InitializeXInputInternal();
@@ -248,9 +241,6 @@ class EVENTS_BASE_EXPORT DeviceDataManager {
double min_value,
double max_value);
- bool IsTouchDeviceIdValid(int touch_device_id) const;
-
- static const int kMaxDeviceNum = 128;
static const int kMaxXIEventType = XI_LASTEVENT + 1;
static const int kMaxSlotNum = 10;
@@ -296,14 +286,9 @@ class EVENTS_BASE_EXPORT DeviceDataManager {
unsigned char button_map_[256];
int button_map_count_;
- // Table to keep track of which display id is mapped to which touch device.
- int64 touch_device_to_display_map_[kMaxDeviceNum];
- // Index table to find the TouchTransformer for a touch device.
- gfx::Transform touch_device_transformer_map_[kMaxDeviceNum];
-
- DISALLOW_COPY_AND_ASSIGN(DeviceDataManager);
+ DISALLOW_COPY_AND_ASSIGN(DeviceDataManagerX11);
};
} // namespace ui
-#endif // UI_EVENTS_X_DEVICE_DATA_MANAGER_H_
+#endif // UI_EVENTS_X_DEVICE_DATA_MANAGER_X11_H_

Powered by Google App Engine
This is Rietveld 408576698