| 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 #include "modules/bluetooth/BluetoothError.h" | 5 #include "modules/bluetooth/BluetoothError.h" |
| 6 | 6 |
| 7 #include "core/dom/DOMException.h" | 7 #include "core/dom/DOMException.h" |
| 8 #include "core/dom/ExceptionCode.h" | 8 #include "core/dom/ExceptionCode.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 MAP_ERROR(ConnectWriteNotPermitted, NetworkError, "GATT write operation
is not permitted."); | 41 MAP_ERROR(ConnectWriteNotPermitted, NetworkError, "GATT write operation
is not permitted."); |
| 42 MAP_ERROR(DeviceNoLongerInRange, NetworkError, "Bluetooth Device is no l
onger in range."); | 42 MAP_ERROR(DeviceNoLongerInRange, NetworkError, "Bluetooth Device is no l
onger in range."); |
| 43 MAP_ERROR(GATTNotPaired, NetworkError, "GATT Error: Not paired."); | 43 MAP_ERROR(GATTNotPaired, NetworkError, "GATT Error: Not paired."); |
| 44 MAP_ERROR(GATTOperationInProgress, NetworkError, "GATT operation already
in progress."); | 44 MAP_ERROR(GATTOperationInProgress, NetworkError, "GATT operation already
in progress."); |
| 45 MAP_ERROR(UntranslatedConnectErrorCode, NetworkError, "Unknown ConnectEr
rorCode."); | 45 MAP_ERROR(UntranslatedConnectErrorCode, NetworkError, "Unknown ConnectEr
rorCode."); |
| 46 | 46 |
| 47 // NotFoundErrors: | 47 // NotFoundErrors: |
| 48 MAP_ERROR(NoBluetoothAdapter, NotFoundError, "Bluetooth adapter not avai
lable."); | 48 MAP_ERROR(NoBluetoothAdapter, NotFoundError, "Bluetooth adapter not avai
lable."); |
| 49 MAP_ERROR(ChosenDeviceVanished, NotFoundError, "User selected a device t
hat doesn't exist anymore."); | 49 MAP_ERROR(ChosenDeviceVanished, NotFoundError, "User selected a device t
hat doesn't exist anymore."); |
| 50 MAP_ERROR(ChooserCancelled, NotFoundError, "User cancelled the requestDe
vice() chooser."); | 50 MAP_ERROR(ChooserCancelled, NotFoundError, "User cancelled the requestDe
vice() chooser."); |
| 51 MAP_ERROR(ChooserDisabled, NotFoundError, "User or their enterprise poli
cy has disabled Web Bluetooth globally."); | 51 MAP_ERROR(ChooserDisabled, NotFoundError, "User or their enterprise poli
cy has disabled Web Bluetooth."); |
| 52 MAP_ERROR(KillSwitchEnabled, NotFoundError, "Web Bluetooth permission gl
obally disabled."); |
| 52 MAP_ERROR(ChooserDeniedPermission, NotFoundError, "User denied the brows
er permission to scan for Bluetooth devices."); | 53 MAP_ERROR(ChooserDeniedPermission, NotFoundError, "User denied the brows
er permission to scan for Bluetooth devices."); |
| 53 MAP_ERROR(ServiceNotFound, NotFoundError, "Service not found in device."
); | 54 MAP_ERROR(ServiceNotFound, NotFoundError, "Service not found in device."
); |
| 54 MAP_ERROR(CharacteristicNotFound, NotFoundError, "No Characteristics wit
h specified UUID found in Service."); | 55 MAP_ERROR(CharacteristicNotFound, NotFoundError, "No Characteristics wit
h specified UUID found in Service."); |
| 55 MAP_ERROR(NoCharacteristicsFound, NotFoundError, "No Characteristics fou
nd in service."); | 56 MAP_ERROR(NoCharacteristicsFound, NotFoundError, "No Characteristics fou
nd in service."); |
| 56 | 57 |
| 57 // NotSupportedErrors: | 58 // NotSupportedErrors: |
| 58 MAP_ERROR(GATTUnknownError, NotSupportedError, "GATT Error Unknown."); | 59 MAP_ERROR(GATTUnknownError, NotSupportedError, "GATT Error Unknown."); |
| 59 MAP_ERROR(GATTUnknownFailure, NotSupportedError, "GATT operation failed
for unknown reason."); | 60 MAP_ERROR(GATTUnknownFailure, NotSupportedError, "GATT operation failed
for unknown reason."); |
| 60 MAP_ERROR(GATTNotPermitted, NotSupportedError, "GATT operation not permi
tted."); | 61 MAP_ERROR(GATTNotPermitted, NotSupportedError, "GATT operation not permi
tted."); |
| 61 MAP_ERROR(GATTNotSupported, NotSupportedError, "GATT Error: Not supporte
d."); | 62 MAP_ERROR(GATTNotSupported, NotSupportedError, "GATT Error: Not supporte
d."); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 72 MAP_ERROR(RequestDeviceWithoutFrame, SecurityError, "No window to show t
he requestDevice() dialog."); | 73 MAP_ERROR(RequestDeviceWithoutFrame, SecurityError, "No window to show t
he requestDevice() dialog."); |
| 73 | 74 |
| 74 #undef MAP_ERROR | 75 #undef MAP_ERROR |
| 75 } | 76 } |
| 76 | 77 |
| 77 ASSERT_NOT_REACHED(); | 78 ASSERT_NOT_REACHED(); |
| 78 return DOMException::create(UnknownError); | 79 return DOMException::create(UnknownError); |
| 79 } | 80 } |
| 80 | 81 |
| 81 } // namespace blink | 82 } // namespace blink |
| OLD | NEW |