Index: content/browser/bluetooth/bluetooth_dispatcher_host.cc |
diff --git a/content/browser/bluetooth/bluetooth_dispatcher_host.cc b/content/browser/bluetooth/bluetooth_dispatcher_host.cc |
index 209a3517c16f68cd58a7a197f62c1781d132a828..35b395f50f9e1e41117184f0ccaae0470a228ab1 100644 |
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.cc |
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.cc |
@@ -757,13 +757,7 @@ void BluetoothDispatcherHost::OnRequestDeviceImpl( |
return; |
} |
- // Populate the initial list of devices. |
- VLOG(1) << "Populating " << adapter_->GetDevices().size() |
- << " devices in chooser " << chooser_id; |
- for (const device::BluetoothDevice* device : adapter_->GetDevices()) { |
- VLOG(1) << "\t" << device->GetAddress(); |
- session->AddFilteredDevice(*device); |
- } |
+ PopulateWithExistingDevices(session, chooser_id); |
if (!session->chooser) { |
// If the dialog's closing, no need to do any of the rest of this. |
@@ -824,6 +818,7 @@ void BluetoothDispatcherHost::OnBluetoothChooserEvent( |
<< ") from a closed chooser."; |
switch (event) { |
case BluetoothChooser::Event::RESCAN: |
+ PopulateWithExistingDevices(session, chooser_id); |
StartDeviceDiscovery(session, chooser_id); |
// No need to close the chooser so we return. |
return; |
@@ -1013,4 +1008,16 @@ url::Origin BluetoothDispatcherHost::GetOrigin(int frame_routing_id) { |
->GetLastCommittedOrigin(); |
} |
+void BluetoothDispatcherHost::PopulateWithExistingDevices( |
+ RequestDeviceSession* session, |
+ int chooser_id) { |
+ // Populate the initial list of devices. |
scheib
2016/05/06 00:41:50
This comment not needed now that the code block is
|
+ VLOG(1) << "Populating " << adapter_->GetDevices().size() |
+ << " devices in chooser " << chooser_id; |
+ for (const device::BluetoothDevice* device : adapter_->GetDevices()) { |
+ VLOG(1) << "\t" << device->GetAddress(); |
+ session->AddFilteredDevice(*device); |
+ } |
+} |
+ |
} // namespace content |