| Index: content/browser/bluetooth/bluetooth_device_chooser_controller.cc
|
| diff --git a/content/browser/bluetooth/bluetooth_device_chooser_controller.cc b/content/browser/bluetooth/bluetooth_device_chooser_controller.cc
|
| index 7986f72a8ceb1c9035b8cffcc8b4dffa1b3e5e3a..b2d8792f0c4a5fd5ddccd1b9594b719793ec41df 100644
|
| --- a/content/browser/bluetooth/bluetooth_device_chooser_controller.cc
|
| +++ b/content/browser/bluetooth/bluetooth_device_chooser_controller.cc
|
| @@ -321,7 +321,7 @@ void BluetoothDeviceChooserController::GetDevice(
|
| return;
|
| }
|
|
|
| - PopulateFoundDevices();
|
| + PopulateConnectedDevices();
|
| if (!chooser_.get()) {
|
| // If the dialog's closing, no need to do any of the rest of this.
|
| return;
|
| @@ -339,7 +339,6 @@ void BluetoothDeviceChooserController::GetDevice(
|
| void BluetoothDeviceChooserController::AddFilteredDevice(
|
| const device::BluetoothDevice& device) {
|
| if (chooser_.get() && MatchesFilters(device, options_->filters)) {
|
| - VLOG(1) << "Adding device to chooser: " << device.GetAddress();
|
| chooser_->AddOrUpdateDevice(
|
| device.GetAddress(),
|
| // TODO(https://crbug.com/634366): Update device's name when necessary.
|
| @@ -375,11 +374,11 @@ void BluetoothDeviceChooserController::SetTestScanDurationForTesting() {
|
| BluetoothDeviceChooserController::use_test_scan_duration_ = true;
|
| }
|
|
|
| -void BluetoothDeviceChooserController::PopulateFoundDevices() {
|
| - VLOG(1) << "Populating " << adapter_->GetDevices().size()
|
| - << " devices in chooser.";
|
| +void BluetoothDeviceChooserController::PopulateConnectedDevices() {
|
| for (const device::BluetoothDevice* device : adapter_->GetDevices()) {
|
| - AddFilteredDevice(*device);
|
| + if (device->IsGattConnected()) {
|
| + AddFilteredDevice(*device);
|
| + }
|
| }
|
| }
|
|
|
| @@ -439,7 +438,7 @@ void BluetoothDeviceChooserController::OnBluetoothChooserEvent(
|
|
|
| switch (event) {
|
| case BluetoothChooser::Event::RESCAN:
|
| - PopulateFoundDevices();
|
| + PopulateConnectedDevices();
|
| DCHECK(chooser_);
|
| StartDeviceDiscovery();
|
| // No need to close the chooser so we return.
|
|
|