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 "config.h" | 5 #include "config.h" |
6 #include "modules/bluetooth/BluetoothError.h" | 6 #include "modules/bluetooth/BluetoothError.h" |
7 | 7 |
8 #include "core/dom/DOMException.h" | 8 #include "core/dom/DOMException.h" |
9 #include "core/dom/ExceptionCode.h" | 9 #include "core/dom/ExceptionCode.h" |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 MAP_ERROR(ConnectAuthFailed, NetworkError, "Authentication failed."); | 34 MAP_ERROR(ConnectAuthFailed, NetworkError, "Authentication failed."); |
35 MAP_ERROR(ConnectAuthCanceled, NetworkError, "Authentication canceled.")
; | 35 MAP_ERROR(ConnectAuthCanceled, NetworkError, "Authentication canceled.")
; |
36 MAP_ERROR(ConnectAuthRejected, NetworkError, "Authentication rejected.")
; | 36 MAP_ERROR(ConnectAuthRejected, NetworkError, "Authentication rejected.")
; |
37 MAP_ERROR(ConnectAuthTimeout, NetworkError, "Authentication timeout."); | 37 MAP_ERROR(ConnectAuthTimeout, NetworkError, "Authentication timeout."); |
38 MAP_ERROR(ConnectUnsupportedDevice, NetworkError, "Unsupported device.")
; | 38 MAP_ERROR(ConnectUnsupportedDevice, NetworkError, "Unsupported device.")
; |
39 MAP_ERROR(UntranslatedConnectErrorCode, NetworkError, "Unknown ConnectEr
rorCode."); | 39 MAP_ERROR(UntranslatedConnectErrorCode, NetworkError, "Unknown ConnectEr
rorCode."); |
40 | 40 |
41 // NotFoundErrors: | 41 // NotFoundErrors: |
42 MAP_ERROR(BluetoothAdapterOff, NotFoundError, "Bluetooth adapter is off.
"); | 42 MAP_ERROR(BluetoothAdapterOff, NotFoundError, "Bluetooth adapter is off.
"); |
43 MAP_ERROR(NoBluetoothAdapter, NotFoundError, "Bluetooth adapter not avai
lable."); | 43 MAP_ERROR(NoBluetoothAdapter, NotFoundError, "Bluetooth adapter not avai
lable."); |
| 44 MAP_ERROR(NoBluetoothChooser, NotFoundError, "Can't show Bluetooth choos
er dialog."); |
44 MAP_ERROR(DiscoverySessionStartFailed, NotFoundError, "Couldn't start di
scovery session."); | 45 MAP_ERROR(DiscoverySessionStartFailed, NotFoundError, "Couldn't start di
scovery session."); |
45 MAP_ERROR(DiscoverySessionStopFailed, NotFoundError, "Failed to stop dis
covery session."); | 46 MAP_ERROR(DiscoverySessionStopFailed, NotFoundError, "Failed to stop dis
covery session."); |
| 47 MAP_ERROR(ChosenDeviceVanished, NotFoundError, "User selected a device t
hat doesn't exist anymore."); |
| 48 MAP_ERROR(ChooserCancelled, NotFoundError, "User cancelled the requestDe
vice() chooser."); |
46 MAP_ERROR(NoDevicesFound, NotFoundError, "No Bluetooth devices in range.
"); | 49 MAP_ERROR(NoDevicesFound, NotFoundError, "No Bluetooth devices in range.
"); |
47 MAP_ERROR(ServiceNotFound, NotFoundError, "Service not found in device."
); | 50 MAP_ERROR(ServiceNotFound, NotFoundError, "Service not found in device."
); |
48 MAP_ERROR(CharacteristicNotFound, NotFoundError, "Characteristic not fou
nd in device."); | 51 MAP_ERROR(CharacteristicNotFound, NotFoundError, "Characteristic not fou
nd in device."); |
49 | 52 |
50 // NotSupportedErrors: | 53 // NotSupportedErrors: |
51 MAP_ERROR(GATTUnknownError, NotSupportedError, "GATT Error Unknown."); | 54 MAP_ERROR(GATTUnknownError, NotSupportedError, "GATT Error Unknown."); |
52 MAP_ERROR(GATTUnknownFailure, NotSupportedError, "GATT operation failed
for unknown reason."); | 55 MAP_ERROR(GATTUnknownFailure, NotSupportedError, "GATT operation failed
for unknown reason."); |
53 MAP_ERROR(GATTNotPermitted, NotSupportedError, "GATT operation not permi
tted."); | 56 MAP_ERROR(GATTNotPermitted, NotSupportedError, "GATT operation not permi
tted."); |
54 MAP_ERROR(GATTNotSupported, NotSupportedError, "GATT Error: Not supporte
d."); | 57 MAP_ERROR(GATTNotSupported, NotSupportedError, "GATT Error: Not supporte
d."); |
55 MAP_ERROR(GATTUntranslatedErrorCode, NotSupportedError, "GATT Error: Unk
nown GattErrorCode."); | 58 MAP_ERROR(GATTUntranslatedErrorCode, NotSupportedError, "GATT Error: Unk
nown GattErrorCode."); |
56 | 59 |
57 // SecurityErrors: | 60 // SecurityErrors: |
58 MAP_ERROR(GATTNotAuthorized, SecurityError, "GATT operation not authoriz
ed."); | 61 MAP_ERROR(GATTNotAuthorized, SecurityError, "GATT operation not authoriz
ed."); |
59 MAP_ERROR(RequestDeviceWithoutFrame, SecurityError, "No window to show t
he requestDevice() dialog."); | 62 MAP_ERROR(RequestDeviceWithoutFrame, SecurityError, "No window to show t
he requestDevice() dialog."); |
60 | 63 |
61 #undef MAP_ERROR | 64 #undef MAP_ERROR |
62 } | 65 } |
63 | 66 |
64 ASSERT_NOT_REACHED(); | 67 ASSERT_NOT_REACHED(); |
65 return DOMException::create(UnknownError); | 68 return DOMException::create(UnknownError); |
66 } | 69 } |
67 | 70 |
68 } // namespace blink | 71 } // namespace blink |
OLD | NEW |