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: | 5 // ID Not In Map Note: |
6 // A service, characteristic, or descriptor ID not in the corresponding | 6 // A service, characteristic, or descriptor ID not in the corresponding |
7 // WebBluetoothServiceImpl map [service_id_to_device_address_, | 7 // WebBluetoothServiceImpl map [service_id_to_device_address_, |
8 // characteristic_id_to_service_id_, descriptor_to_characteristic_] implies a | 8 // characteristic_id_to_service_id_, descriptor_to_characteristic_] implies a |
9 // hostile renderer because a renderer obtains the corresponding ID from this | 9 // hostile renderer because a renderer obtains the corresponding ID from this |
10 // class and it will be added to the map at that time. | 10 // class and it will be added to the map at that time. |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 223 |
224 void WebBluetoothServiceImpl::AdapterPoweredChanged( | 224 void WebBluetoothServiceImpl::AdapterPoweredChanged( |
225 device::BluetoothAdapter* adapter, | 225 device::BluetoothAdapter* adapter, |
226 bool powered) { | 226 bool powered) { |
227 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 227 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
228 if (device_chooser_controller_.get()) { | 228 if (device_chooser_controller_.get()) { |
229 device_chooser_controller_->AdapterPoweredChanged(powered); | 229 device_chooser_controller_->AdapterPoweredChanged(powered); |
230 } | 230 } |
231 } | 231 } |
232 | 232 |
| 233 void WebBluetoothServiceImpl::AdapterDiscoveringChanged( |
| 234 device::BluetoothAdapter* adapter, |
| 235 bool discovering) { |
| 236 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 237 if (device_chooser_controller_.get()) { |
| 238 device_chooser_controller_->AdapterDiscoveringChanged(discovering); |
| 239 } |
| 240 } |
| 241 |
233 void WebBluetoothServiceImpl::DeviceAdded(device::BluetoothAdapter* adapter, | 242 void WebBluetoothServiceImpl::DeviceAdded(device::BluetoothAdapter* adapter, |
234 device::BluetoothDevice* device) { | 243 device::BluetoothDevice* device) { |
235 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 244 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
236 if (device_chooser_controller_.get()) { | 245 if (device_chooser_controller_.get()) { |
237 device_chooser_controller_->AddFilteredDevice(*device); | 246 device_chooser_controller_->AddFilteredDevice(*device); |
238 } | 247 } |
239 } | 248 } |
240 | 249 |
241 void WebBluetoothServiceImpl::DeviceChanged(device::BluetoothAdapter* adapter, | 250 void WebBluetoothServiceImpl::DeviceChanged(device::BluetoothAdapter* adapter, |
242 device::BluetoothDevice* device) { | 251 device::BluetoothDevice* device) { |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 characteristic_id_to_service_id_.clear(); | 1009 characteristic_id_to_service_id_.clear(); |
1001 service_id_to_device_address_.clear(); | 1010 service_id_to_device_address_.clear(); |
1002 connected_devices_.reset( | 1011 connected_devices_.reset( |
1003 new FrameConnectedBluetoothDevices(render_frame_host_)); | 1012 new FrameConnectedBluetoothDevices(render_frame_host_)); |
1004 allowed_devices_map_ = BluetoothAllowedDevicesMap(); | 1013 allowed_devices_map_ = BluetoothAllowedDevicesMap(); |
1005 device_chooser_controller_.reset(); | 1014 device_chooser_controller_.reset(); |
1006 BluetoothAdapterFactoryWrapper::Get().ReleaseAdapter(this); | 1015 BluetoothAdapterFactoryWrapper::Get().ReleaseAdapter(this); |
1007 } | 1016 } |
1008 | 1017 |
1009 } // namespace content | 1018 } // namespace content |
OLD | NEW |