Chromium Code Reviews| 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 71f66c3f8083cded7e21ab6bc9cd23c1b93de6cf..8827894b6288e86bf0e9f1cd7bc35c4f5c1f676d 100644 |
| --- a/content/browser/bluetooth/bluetooth_dispatcher_host.cc |
| +++ b/content/browser/bluetooth/bluetooth_dispatcher_host.cc |
| @@ -712,18 +712,19 @@ void BluetoothDispatcherHost::OnGATTServerDisconnect( |
| return; |
| } |
| - RenderFrameHostImpl* render_frame_host = |
| - RenderFrameHostImpl::FromID(render_process_id_, frame_routing_id); |
| - WebContents* web_contents = |
| - WebContents::FromRenderFrameHost(render_frame_host); |
| - if (web_contents) { |
| - web_contents->SetBluetoothDeviceConnected(false); |
| - } |
| - |
| // The last BluetoothGattConnection for a device closes the connection when |
| // it's destroyed. |
| if (device_id_to_connection_map_.erase(device_id)) { |
| VLOG(1) << "Disconnecting device: " << device_id; |
| + |
| + // Indicate there is one less connected device. |
|
Jeffrey Yasskin
2016/04/06 23:05:13
Add a TODO here saying that this can miss disconne
ortuno
2016/04/07 15:09:20
Done.
|
| + RenderFrameHostImpl* render_frame_host = |
| + RenderFrameHostImpl::FromID(render_process_id_, frame_routing_id); |
| + WebContents* web_contents = |
| + WebContents::FromRenderFrameHost(render_frame_host); |
| + if (web_contents) { |
| + web_contents->DecrementBluetoothConnectedDeviceCount(); |
| + } |
| } |
| } |
| @@ -1420,7 +1421,7 @@ void BluetoothDispatcherHost::OnGATTConnectionCreated( |
| WebContents* web_contents = |
| WebContents::FromRenderFrameHost(render_frame_host); |
| if (web_contents) { |
| - web_contents->SetBluetoothDeviceConnected(true); |
| + web_contents->IncrementBluetoothConnectedDeviceCount(); |
| } |
| Send(new BluetoothMsg_GATTServerConnectSuccess(thread_id, request_id)); |
| } |