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 21 matching lines...) Expand all Loading... |
32 MAP_ERROR(ConnectAlreadyInProgress, NetworkError, "Connection already in
progress."); | 32 MAP_ERROR(ConnectAlreadyInProgress, NetworkError, "Connection already in
progress."); |
33 MAP_ERROR(ConnectUnknownFailure, NetworkError, "Connection failed for un
known reason."); | 33 MAP_ERROR(ConnectUnknownFailure, NetworkError, "Connection failed for un
known reason."); |
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.
"); | |
43 MAP_ERROR(NoBluetoothAdapter, NotFoundError, "Bluetooth adapter not avai
lable."); | 42 MAP_ERROR(NoBluetoothAdapter, NotFoundError, "Bluetooth adapter not avai
lable."); |
44 MAP_ERROR(NoBluetoothChooser, NotFoundError, "Can't show Bluetooth choos
er dialog."); | |
45 MAP_ERROR(DiscoverySessionStartFailed, NotFoundError, "Couldn't start di
scovery 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."); | 43 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."); | 44 MAP_ERROR(ChooserCancelled, NotFoundError, "User cancelled the requestDe
vice() chooser."); |
49 MAP_ERROR(NoDevicesFound, NotFoundError, "No Bluetooth devices in range.
"); | |
50 MAP_ERROR(ServiceNotFound, NotFoundError, "Service not found in device."
); | 45 MAP_ERROR(ServiceNotFound, NotFoundError, "Service not found in device."
); |
51 MAP_ERROR(CharacteristicNotFound, NotFoundError, "Characteristic not fou
nd in device."); | 46 MAP_ERROR(CharacteristicNotFound, NotFoundError, "Characteristic not fou
nd in device."); |
52 | 47 |
53 // NotSupportedErrors: | 48 // NotSupportedErrors: |
54 MAP_ERROR(GATTUnknownError, NotSupportedError, "GATT Error Unknown."); | 49 MAP_ERROR(GATTUnknownError, NotSupportedError, "GATT Error Unknown."); |
55 MAP_ERROR(GATTUnknownFailure, NotSupportedError, "GATT operation failed
for unknown reason."); | 50 MAP_ERROR(GATTUnknownFailure, NotSupportedError, "GATT operation failed
for unknown reason."); |
56 MAP_ERROR(GATTNotPermitted, NotSupportedError, "GATT operation not permi
tted."); | 51 MAP_ERROR(GATTNotPermitted, NotSupportedError, "GATT operation not permi
tted."); |
57 MAP_ERROR(GATTNotSupported, NotSupportedError, "GATT Error: Not supporte
d."); | 52 MAP_ERROR(GATTNotSupported, NotSupportedError, "GATT Error: Not supporte
d."); |
58 MAP_ERROR(GATTUntranslatedErrorCode, NotSupportedError, "GATT Error: Unk
nown GattErrorCode."); | 53 MAP_ERROR(GATTUntranslatedErrorCode, NotSupportedError, "GATT Error: Unk
nown GattErrorCode."); |
59 | 54 |
60 // SecurityErrors: | 55 // SecurityErrors: |
61 MAP_ERROR(GATTNotAuthorized, SecurityError, "GATT operation not authoriz
ed."); | 56 MAP_ERROR(GATTNotAuthorized, SecurityError, "GATT operation not authoriz
ed."); |
62 MAP_ERROR(RequestDeviceWithoutFrame, SecurityError, "No window to show t
he requestDevice() dialog."); | 57 MAP_ERROR(RequestDeviceWithoutFrame, SecurityError, "No window to show t
he requestDevice() dialog."); |
63 | 58 |
64 #undef MAP_ERROR | 59 #undef MAP_ERROR |
65 } | 60 } |
66 | 61 |
67 ASSERT_NOT_REACHED(); | 62 ASSERT_NOT_REACHED(); |
68 return DOMException::create(UnknownError); | 63 return DOMException::create(UnknownError); |
69 } | 64 } |
70 | 65 |
71 } // namespace blink | 66 } // namespace blink |
OLD | NEW |