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

Unified Diff: chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.cc

Issue 770563003: HID fix for device info check. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Dicts used. Created 6 years 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: chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.cc
index 55484ddb893352c07e8bf18af15b2a02e6a2a74e..1db015521fae26d566524af81443cd01bba0f707 100644
--- a/chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.cc
@@ -29,12 +29,13 @@ const char kJsScreenPath[] = "login.HIDDetectionScreen";
const char kRemotePinCode[] = "bluetoothRemotePinCode";
const char kRemotePasskey[] = "bluetoothRemotePasskey";
-// Possible ui-states for device-blocks.
+// Possible ui-states for device-blocks. Same as CONNECTION dict of
+// HIDDetectionScreen
const char kSearchingState[] = "searching";
const char kUSBConnectedState[] = "connected";
const char kBTPairedState[] = "paired";
const char kBTPairingState[] = "pairing";
-// Special state for notifications that don't switch ui-state, but add info.
+// Special state for notifications that doesn't switch ui-state, but adds info.
const char kBTUpdateState[] = "update";
// Names of possible arguments used for ui update.
@@ -61,6 +62,10 @@ bool DeviceIsKeyboard(device::BluetoothDevice::DeviceType device_type) {
device_type == device::BluetoothDevice::DEVICE_KEYBOARD_MOUSE_COMBO;
}
+bool DeviceIsKeyboard(const device::InputServiceLinux::InputDeviceInfo& info) {
+ return info.is_keyboard || info.is_touchscreen || info.is_tablet;
+}
+
} // namespace
namespace chromeos {
@@ -123,10 +128,8 @@ void HIDDetectionScreenHandler::Show() {
num_of_times_dialog_was_shown + 1);
ShowScreen(OobeUI::kScreenHIDDetection, NULL);
- if (!pointing_device_id_.empty())
- SendPointingDeviceNotification();
- if (!keyboard_device_id_.empty())
- SendKeyboardDeviceNotification(NULL);
+ SendPointingDeviceNotification();
+ SendKeyboardDeviceNotification(NULL);
}
void HIDDetectionScreenHandler::Hide() {
@@ -369,7 +372,7 @@ void HIDDetectionScreenHandler::OnInputDeviceAdded(
pointing_device_connect_type_ = info.type;
SendPointingDeviceNotification();
}
- if (keyboard_device_id_.empty() && info.is_keyboard) {
+ if (keyboard_device_id_.empty() && DeviceIsKeyboard(info)) {
keyboard_device_id_ = info.id;
keyboard_device_name_ = info.name;
keyboard_device_connect_type_ = info.type;

Powered by Google App Engine
This is Rietveld 408576698