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

Unified Diff: ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc

Issue 460093003: Disable core keyboard device as well when entering touchview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc
diff --git a/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc b/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc
index 2f1056d68f88069466803000bf5dc8c0147be5fc..c78c406d729e48234cb4a4d34e62fece3904e06c 100644
--- a/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc
+++ b/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc
@@ -36,6 +36,10 @@ const char kInternalTouchpadName[] = "Elan Touchpad";
// The name of the xinput device corresponding to the internal keyboard.
const char kInternalKeyboardName[] = "AT Translated Set 2 keyboard";
+// Repeated key events have their source set to the core keyboard device.
+// These must be disabled also until http://crbug.com/402898 is resolved.
+const char kCoreKeyboardName[] = "Virtual core keyboard";
+
// Device id used to indicate that a device has not been detected.
const int kDeviceIdNone = -1;
@@ -64,6 +68,7 @@ ScopedDisableInternalMouseAndKeyboardX11::
ScopedDisableInternalMouseAndKeyboardX11()
: touchpad_device_id_(kDeviceIdNone),
keyboard_device_id_(kDeviceIdNone),
+ core_keyboard_device_id_(kDeviceIdNone),
last_mouse_location_(GetMouseLocationInScreen()) {
ui::DeviceDataManagerX11* device_data_manager =
@@ -81,6 +86,9 @@ ScopedDisableInternalMouseAndKeyboardX11::
} else if (device_name == kInternalKeyboardName) {
keyboard_device_id_ = xi_dev_list[i].deviceid;
device_data_manager->DisableDevice(keyboard_device_id_);
+ } else if (device_name == kCoreKeyboardName) {
+ core_keyboard_device_id_ = xi_dev_list[i].deviceid;
+ device_data_manager->DisableDevice(core_keyboard_device_id_);
}
}
}
@@ -104,6 +112,8 @@ ScopedDisableInternalMouseAndKeyboardX11::
device_data_manager->EnableDevice(touchpad_device_id_);
if (keyboard_device_id_ != kDeviceIdNone)
device_data_manager->EnableDevice(keyboard_device_id_);
+ if (core_keyboard_device_id_ != kDeviceIdNone)
+ device_data_manager->EnableDevice(core_keyboard_device_id_);
device_data_manager->SetDisabledKeyboardAllowedKeys(
scoped_ptr<std::set<ui::KeyboardCode> >());
ui::PlatformEventSource::GetInstance()->RemovePlatformEventObserver(this);
« no previous file with comments | « ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698