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

Unified Diff: ui/events/device_data_manager.h

Issue 618283003: Adds special support to the device manager for keyboards devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do not run x11 test on non-x11 platforms. Created 6 years, 2 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/device_data_manager.h
diff --git a/ui/events/device_data_manager.h b/ui/events/device_data_manager.h
index 54c139b1302b021e22fe7496900d965b336e8a4c..4f3040f37419fe3fc9d637006ca4958d49ad43f0 100644
--- a/ui/events/device_data_manager.h
+++ b/ui/events/device_data_manager.h
@@ -14,6 +14,7 @@
#include "base/observer_list.h"
#include "ui/events/device_hotplug_event_observer.h"
#include "ui/events/events_base_export.h"
+#include "ui/events/keyboard_device.h"
#include "ui/events/touchscreen_device.h"
#include "ui/gfx/transform.h"
@@ -30,6 +31,8 @@ class EVENTS_BASE_EXPORT DeviceDataManager : public DeviceHotplugEventObserver {
static DeviceDataManager* GetInstance();
static bool HasInstance();
+ static const int kMaxDeviceNum = 128;
sky 2014/10/20 22:18:43 See style guide, this should be before destructor.
rsadam 2014/10/21 16:53:52 Done.
+
void ClearTouchTransformerRecord();
void UpdateTouchInfoForDisplay(int64_t display_id,
int touch_device_id,
@@ -44,6 +47,10 @@ class EVENTS_BASE_EXPORT DeviceDataManager : public DeviceHotplugEventObserver {
return touchscreen_devices_;
}
+ const std::vector<KeyboardDevice>& keyboard_devices() const {
+ return keyboard_devices_;
+ }
+
void AddObserver(InputDeviceEventObserver* observer);
void RemoveObserver(InputDeviceEventObserver* observer);
@@ -52,17 +59,17 @@ class EVENTS_BASE_EXPORT DeviceDataManager : public DeviceHotplugEventObserver {
static DeviceDataManager* instance();
- static const int kMaxDeviceNum = 128;
+ // DeviceHotplugEventObserver:
+ virtual void OnTouchscreenDevicesUpdated(
+ const std::vector<TouchscreenDevice>& devices) override;
+ virtual void OnKeyboardDevicesUpdated(
+ const std::vector<KeyboardDevice>& devices) override;
private:
static DeviceDataManager* instance_;
bool IsTouchDeviceIdValid(int touch_device_id) const;
- // DeviceHotplugEventObserver:
- virtual void OnTouchscreenDevicesUpdated(
- const std::vector<TouchscreenDevice>& devices) override;
-
double touch_radius_scale_map_[kMaxDeviceNum];
// Table to keep track of which display id is mapped to which touch device.
@@ -71,6 +78,7 @@ class EVENTS_BASE_EXPORT DeviceDataManager : public DeviceHotplugEventObserver {
gfx::Transform touch_device_transformer_map_[kMaxDeviceNum];
std::vector<TouchscreenDevice> touchscreen_devices_;
+ std::vector<KeyboardDevice> keyboard_devices_;
ObserverList<InputDeviceEventObserver> observers_;

Powered by Google App Engine
This is Rietveld 408576698