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

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

Issue 313913004: Block internal PlatformEvents before they are dispatched in touchview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix updating cursor on enter notify. Created 6 years, 6 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/device_data_manager.cc ('k') | ui/events/x/device_data_manager_x11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/x/device_data_manager_x11.h
diff --git a/ui/events/x/device_data_manager_x11.h b/ui/events/x/device_data_manager_x11.h
index ae756d85b6e59d630d8570a8dda068ed84544c82..d26b58fe88e49255589673d3c06861013f2772b4 100644
--- a/ui/events/x/device_data_manager_x11.h
+++ b/ui/events/x/device_data_manager_x11.h
@@ -16,6 +16,7 @@
#include <bitset>
#include <map>
+#include <set>
#include <vector>
#include "base/basictypes.h"
@@ -223,6 +224,18 @@ class EVENTS_BASE_EXPORT DeviceDataManagerX11 : public DeviceDataManager {
bool TouchEventNeedsCalibrate(int touch_device_id) const;
+ // Disables the physical keyboard except for the |excepted_keys| provided.
+ void DisableKeyboard(scoped_ptr<std::set<KeyboardCode> > excepted_keys);
+ // Re-enables the keyboard after a previous call to DisableKeyboard.
+ void EnableKeyboard();
+
+ // Disables and enables events from devices by device id.
+ void DisableDevice(unsigned int deviceid);
+ void EnableDevice(unsigned int deviceid);
+
+ // Returns true if |native_event| should be blocked.
+ bool IsEventBlocked(const base::NativeEvent& native_event);
+
private:
DeviceDataManagerX11();
virtual ~DeviceDataManagerX11();
@@ -253,6 +266,18 @@ class EVENTS_BASE_EXPORT DeviceDataManagerX11 : public DeviceDataManager {
std::bitset<kMaxDeviceNum> cmt_devices_;
std::bitset<kMaxDeviceNum> touchpads_;
+ // A quick lookup table for determining if events from the XI device
+ // should be blocked.
+ std::bitset<kMaxDeviceNum> blocked_devices_;
+
+ // When true, keyboard events will be blocked.
+ // TODO(flackr): Only block the internal keyboard when XI2 is used for key
+ // events. http://crbug.com/362881.
+ bool blocked_keyboard_;
+
+ // The set of keys allowed while the keyboard is blocked.
+ scoped_ptr<std::set<KeyboardCode> > blocked_keyboard_allowed_keys_;
+
// Number of valuators on the specific device.
int valuator_count_[kMaxDeviceNum];
« no previous file with comments | « ui/events/device_data_manager.cc ('k') | ui/events/x/device_data_manager_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698