| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // NETWORK_ERROR Note: | 5 // NETWORK_ERROR Note: |
| 6 // When a device can't be found in the BluetoothAdapter, that generally | 6 // When a device can't be found in the BluetoothAdapter, that generally |
| 7 // indicates that it's gone out of range. We reject with a NetworkError in that | 7 // indicates that it's gone out of range. We reject with a NetworkError in that |
| 8 // case. | 8 // case. |
| 9 // https://webbluetoothchrome.github.io/web-bluetooth/#dom-bluetoothdevice-conne
ctgatt | 9 // https://webbluetoothchrome.github.io/web-bluetooth/#dom-bluetoothdevice-conne
ctgatt |
| 10 | 10 |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 } | 702 } |
| 703 // Ignore discovery session start errors when the dialog was already closed by | 703 // Ignore discovery session start errors when the dialog was already closed by |
| 704 // the time they happen. | 704 // the time they happen. |
| 705 } | 705 } |
| 706 | 706 |
| 707 void BluetoothDispatcherHost::OnBluetoothChooserEvent( | 707 void BluetoothDispatcherHost::OnBluetoothChooserEvent( |
| 708 int chooser_id, | 708 int chooser_id, |
| 709 BluetoothChooser::Event event, | 709 BluetoothChooser::Event event, |
| 710 const std::string& device_id) { | 710 const std::string& device_id) { |
| 711 switch (event) { | 711 switch (event) { |
| 712 case BluetoothChooser::Event::RESCAN: |
| 713 // TODO(jyasskin): Implement starting a new Bluetooth discovery session. |
| 714 NOTIMPLEMENTED(); |
| 715 break; |
| 712 case BluetoothChooser::Event::CANCELLED: | 716 case BluetoothChooser::Event::CANCELLED: |
| 713 case BluetoothChooser::Event::SELECTED: | 717 case BluetoothChooser::Event::SELECTED: |
| 714 RequestDeviceSession* session = | 718 RequestDeviceSession* session = |
| 715 request_device_sessions_.Lookup(chooser_id); | 719 request_device_sessions_.Lookup(chooser_id); |
| 716 DCHECK(session) << "Shouldn't close the dialog twice."; | 720 DCHECK(session) << "Shouldn't close the dialog twice."; |
| 717 CHECK(session->chooser) << "Shouldn't close the dialog twice."; | 721 CHECK(session->chooser) << "Shouldn't close the dialog twice."; |
| 718 | 722 |
| 719 // Synchronously ensure nothing else calls into the chooser after it has | 723 // Synchronously ensure nothing else calls into the chooser after it has |
| 720 // asked to be closed. | 724 // asked to be closed. |
| 721 session->chooser.reset(); | 725 session->chooser.reset(); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 int thread_id, | 885 int thread_id, |
| 882 int request_id, | 886 int request_id, |
| 883 device::BluetoothGattService::GattErrorCode error_code) { | 887 device::BluetoothGattService::GattErrorCode error_code) { |
| 884 // TranslateGATTError calls RecordGATTOperationOutcome. | 888 // TranslateGATTError calls RecordGATTOperationOutcome. |
| 885 Send(new BluetoothMsg_WriteCharacteristicValueError( | 889 Send(new BluetoothMsg_WriteCharacteristicValueError( |
| 886 thread_id, request_id, | 890 thread_id, request_id, |
| 887 TranslateGATTError(error_code, UMAGATTOperation::CHARACTERISTIC_WRITE))); | 891 TranslateGATTError(error_code, UMAGATTOperation::CHARACTERISTIC_WRITE))); |
| 888 } | 892 } |
| 889 | 893 |
| 890 } // namespace content | 894 } // namespace content |
| OLD | NEW |