OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // ID Not In Map Note: A service, characteristic, or descriptor ID not in the | 5 // ID Not In Map Note: A service, characteristic, or descriptor ID not in the |
6 // corresponding WebBluetoothServiceImpl map [service_id_to_device_address_, | 6 // corresponding WebBluetoothServiceImpl map [service_id_to_device_address_, |
7 // characteristic_id_to_service_id_, descriptor_id_to_characteristic_id_] | 7 // characteristic_id_to_service_id_, descriptor_id_to_characteristic_id_] |
8 // implies a hostile renderer because a renderer obtains the corresponding ID | 8 // implies a hostile renderer because a renderer obtains the corresponding ID |
9 // from this class and it will be added to the map at that time. | 9 // from this class and it will be added to the map at that time. |
10 | 10 |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 205 |
206 void WebBluetoothServiceImpl::AdapterPoweredChanged( | 206 void WebBluetoothServiceImpl::AdapterPoweredChanged( |
207 device::BluetoothAdapter* adapter, | 207 device::BluetoothAdapter* adapter, |
208 bool powered) { | 208 bool powered) { |
209 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 209 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
210 if (device_chooser_controller_.get()) { | 210 if (device_chooser_controller_.get()) { |
211 device_chooser_controller_->AdapterPoweredChanged(powered); | 211 device_chooser_controller_->AdapterPoweredChanged(powered); |
212 } | 212 } |
213 } | 213 } |
214 | 214 |
| 215 void WebBluetoothServiceImpl::AdapterDiscoveringChanged( |
| 216 device::BluetoothAdapter* adapter, |
| 217 bool discovering) { |
| 218 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 219 if (device_chooser_controller_.get()) { |
| 220 device_chooser_controller_->AdapterDiscoveringChanged(discovering); |
| 221 } |
| 222 } |
| 223 |
215 void WebBluetoothServiceImpl::DeviceAdded(device::BluetoothAdapter* adapter, | 224 void WebBluetoothServiceImpl::DeviceAdded(device::BluetoothAdapter* adapter, |
216 device::BluetoothDevice* device) { | 225 device::BluetoothDevice* device) { |
217 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 226 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
218 if (device_chooser_controller_.get()) { | 227 if (device_chooser_controller_.get()) { |
219 device_chooser_controller_->AddFilteredDevice(*device); | 228 device_chooser_controller_->AddFilteredDevice(*device); |
220 } | 229 } |
221 } | 230 } |
222 | 231 |
223 void WebBluetoothServiceImpl::DeviceChanged(device::BluetoothAdapter* adapter, | 232 void WebBluetoothServiceImpl::DeviceChanged(device::BluetoothAdapter* adapter, |
224 device::BluetoothDevice* device) { | 233 device::BluetoothDevice* device) { |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 characteristic_id_to_service_id_.clear(); | 1137 characteristic_id_to_service_id_.clear(); |
1129 service_id_to_device_address_.clear(); | 1138 service_id_to_device_address_.clear(); |
1130 connected_devices_.reset( | 1139 connected_devices_.reset( |
1131 new FrameConnectedBluetoothDevices(render_frame_host_)); | 1140 new FrameConnectedBluetoothDevices(render_frame_host_)); |
1132 allowed_devices_map_ = BluetoothAllowedDevicesMap(); | 1141 allowed_devices_map_ = BluetoothAllowedDevicesMap(); |
1133 device_chooser_controller_.reset(); | 1142 device_chooser_controller_.reset(); |
1134 BluetoothAdapterFactoryWrapper::Get().ReleaseAdapter(this); | 1143 BluetoothAdapterFactoryWrapper::Get().ReleaseAdapter(this); |
1135 } | 1144 } |
1136 | 1145 |
1137 } // namespace content | 1146 } // namespace content |
OLD | NEW |