| 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 dc255a8e9afd601d84c9cb6cfe9969474fefb0eb..04b2405345fc9e829f83d991901e38f5ba15c577 100644
|
| --- a/content/browser/bluetooth/bluetooth_device_chooser_controller.cc
|
| +++ b/content/browser/bluetooth/bluetooth_device_chooser_controller.cc
|
| @@ -326,13 +326,7 @@ void BluetoothDeviceChooserController::GetDevice(
|
| return;
|
| }
|
|
|
| - // Populate the initial list of devices.
|
| - VLOG(1) << "Populating " << adapter_->GetDevices().size()
|
| - << " devices in chooser.";
|
| - for (const device::BluetoothDevice* device : adapter_->GetDevices()) {
|
| - AddFilteredDevice(*device);
|
| - }
|
| -
|
| + PopulateFoundDevices();
|
| if (!chooser_.get()) {
|
| // If the dialog's closing, no need to do any of the rest of this.
|
| return;
|
| @@ -371,6 +365,14 @@ void BluetoothDeviceChooserController::AdapterPoweredChanged(bool powered) {
|
| }
|
| }
|
|
|
| +void BluetoothDeviceChooserController::PopulateFoundDevices() {
|
| + VLOG(1) << "Populating " << adapter_->GetDevices().size()
|
| + << " devices in chooser.";
|
| + for (const device::BluetoothDevice* device : adapter_->GetDevices()) {
|
| + AddFilteredDevice(*device);
|
| + }
|
| +}
|
| +
|
| void BluetoothDeviceChooserController::StartDeviceDiscovery() {
|
| DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
|
| @@ -427,6 +429,8 @@ void BluetoothDeviceChooserController::OnBluetoothChooserEvent(
|
|
|
| switch (event) {
|
| case BluetoothChooser::Event::RESCAN:
|
| + PopulateFoundDevices();
|
| + DCHECK(chooser_);
|
| StartDeviceDiscovery();
|
| // No need to close the chooser so we return.
|
| return;
|
|
|