
When a connected bluetooth mouse is disconnected, and if it was the only external mouse device, the Chrome OS device should enter tablet mode. And when a connected bluetooth keyboard is disconnected, and if it was the only external keyboard device and no internal keyboard device, the virtual keyboard should pop up. However, it's not the case currently. The reason of this issue is ui::InputDeviceEventObserver doesn't have knowledge of Bluetooth device status and then when a Bluetooth device got connected/disconnected, it doesn't send out notification to notify its observers about the change. And there is no map from an InputDevice to a BluetoothDevice, thus it's impossible to know if an InputDevice is a BluetoothDevice and its status. TabletModeController and VirtualKeyboardController are both only ui::InputDeviceEventObserver and thus don't behave correctly when a Bluetooth device status changed. This CL adds a BluetoothDevicesObserver to observe BluetoothDevices change. It's more like a temporary fix, and I *think* the more correct underlying fix is let DeviceDataManager and InputDeviceClient (the classes to manage InputDevices) to send out the correct notification. The device lists that DeviceDataManager maintains comes from DeviceManagerUdev, and DeviceManagerUdev can send out the correct ADD type DeviceEvent when a bluetooth device is connected, but can not send out DeviceEvent when a bluetooth device is disconnected. We probably should make DeviceManagerUdev supports BluetoothDevices change. Bug: 882541 Change-Id: I2e8e6f56fe2f898bcde84f0eea24d9f2a69c9a05 Reviewed-on: https://chromium-review.googlesource.com/1222991 Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org> Reviewed-by: Giovanni Ortuño Urquidi <ortuno@chromium.org> Commit-Queue: Xiaoqian Dai <xdai@chromium.org> Cr-Commit-Position: refs/heads/master@{#594094}
This directory contains UI frameworks used to build various user interface features. This directory it not intended to contain UI features (such as a keyboard).