OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 } | 491 } |
492 | 492 |
493 void HIDDetectionScreenHandler::BTConnectError( | 493 void HIDDetectionScreenHandler::BTConnectError( |
494 const std::string& address, | 494 const std::string& address, |
495 device::BluetoothDevice::DeviceType device_type, | 495 device::BluetoothDevice::DeviceType device_type, |
496 device::BluetoothDevice::ConnectErrorCode error_code) { | 496 device::BluetoothDevice::ConnectErrorCode error_code) { |
497 LOG(WARNING) << "BTConnectError while connecting " << address | 497 LOG(WARNING) << "BTConnectError while connecting " << address |
498 << " error code = " << error_code; | 498 << " error code = " << error_code; |
499 if (DeviceIsPointing(device_type)) | 499 if (DeviceIsPointing(device_type)) |
500 mouse_is_pairing_ = false; | 500 mouse_is_pairing_ = false; |
501 if (DeviceIsKeyboard(device_type)) | 501 if (DeviceIsKeyboard(device_type)) { |
502 keyboard_is_pairing_ = false; | 502 keyboard_is_pairing_ = false; |
| 503 SendKeyboardDeviceNotification(NULL); |
| 504 } |
503 | 505 |
504 if (pointing_device_id_.empty() || keyboard_device_id_.empty()) | 506 if (pointing_device_id_.empty() || keyboard_device_id_.empty()) |
505 UpdateDevices(); | 507 UpdateDevices(); |
506 } | 508 } |
507 | 509 |
508 | 510 |
509 void HIDDetectionScreenHandler::SendPointingDeviceNotification() { | 511 void HIDDetectionScreenHandler::SendPointingDeviceNotification() { |
510 std::string state; | 512 std::string state; |
511 if (pointing_device_id_.empty()) | 513 if (pointing_device_id_.empty()) |
512 state = kSearchingState; | 514 state = kSearchingState; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 l10n_util::GetStringFUTF16( | 548 l10n_util::GetStringFUTF16( |
547 IDS_HID_DETECTION_PAIRED_BLUETOOTH_KEYBOARD, | 549 IDS_HID_DETECTION_PAIRED_BLUETOOTH_KEYBOARD, |
548 base::UTF8ToUTF16(keyboard_device_name_))); | 550 base::UTF8ToUTF16(keyboard_device_name_))); |
549 } else { | 551 } else { |
550 state_info.SetString("state", kUSBConnectedState); | 552 state_info.SetString("state", kUSBConnectedState); |
551 } | 553 } |
552 CallJS("setKeyboardDeviceState", state_info); | 554 CallJS("setKeyboardDeviceState", state_info); |
553 } | 555 } |
554 | 556 |
555 } // namespace chromeos | 557 } // namespace chromeos |
OLD | NEW |