Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothError.cpp

Issue 1706503002: Add enterprise policy to turn off Bluetooth. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Fix nits Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(ChooserDeniedPermission, NotFoundError, "User denied the brows er permission to scan for Bluetooth devices."); 52 MAP_ERROR(ChooserDeniedPermission, NotFoundError, "User denied the brows er permission to scan for Bluetooth devices.");
52 MAP_ERROR(ServiceNotFound, NotFoundError, "Service not found in device." ); 53 MAP_ERROR(ServiceNotFound, NotFoundError, "Service not found in device." );
53 MAP_ERROR(CharacteristicNotFound, NotFoundError, "Characteristic not fou nd in device."); 54 MAP_ERROR(CharacteristicNotFound, NotFoundError, "Characteristic not fou nd in device.");
54 55
55 // NotSupportedErrors: 56 // NotSupportedErrors:
56 MAP_ERROR(GATTUnknownError, NotSupportedError, "GATT Error Unknown."); 57 MAP_ERROR(GATTUnknownError, NotSupportedError, "GATT Error Unknown.");
57 MAP_ERROR(GATTUnknownFailure, NotSupportedError, "GATT operation failed for unknown reason."); 58 MAP_ERROR(GATTUnknownFailure, NotSupportedError, "GATT operation failed for unknown reason.");
58 MAP_ERROR(GATTNotPermitted, NotSupportedError, "GATT operation not permi tted."); 59 MAP_ERROR(GATTNotPermitted, NotSupportedError, "GATT operation not permi tted.");
59 MAP_ERROR(GATTNotSupported, NotSupportedError, "GATT Error: Not supporte d."); 60 MAP_ERROR(GATTNotSupported, NotSupportedError, "GATT Error: Not supporte d.");
60 MAP_ERROR(GATTUntranslatedErrorCode, NotSupportedError, "GATT Error: Unk nown GattErrorCode."); 61 MAP_ERROR(GATTUntranslatedErrorCode, NotSupportedError, "GATT Error: Unk nown GattErrorCode.");
61 62
62 // SecurityErrors: 63 // SecurityErrors:
63 MAP_ERROR(GATTNotAuthorized, SecurityError, "GATT operation not authoriz ed."); 64 MAP_ERROR(GATTNotAuthorized, SecurityError, "GATT operation not authoriz ed.");
64 MAP_ERROR(BlacklistedCharacteristicUUID, SecurityError, "getCharacterist ic(s) called with blacklisted UUID. https://goo.gl/4NeimX"); 65 MAP_ERROR(BlacklistedCharacteristicUUID, SecurityError, "getCharacterist ic(s) called with blacklisted UUID. https://goo.gl/4NeimX");
65 MAP_ERROR(NotAllowedToAccessService, SecurityError, "Origin is not allow ed to access the service. Remember to add the service to a filter or to optional Services in requestDevice()."); 66 MAP_ERROR(NotAllowedToAccessService, SecurityError, "Origin is not allow ed to access the service. Remember to add the service to a filter or to optional Services in requestDevice().");
66 MAP_ERROR(RequestDeviceWithBlacklistedUUID, SecurityError, "requestDevic e() called with a filter containing a blacklisted UUID. https://goo.gl/4NeimX"); 67 MAP_ERROR(RequestDeviceWithBlacklistedUUID, SecurityError, "requestDevic e() called with a filter containing a blacklisted UUID. https://goo.gl/4NeimX");
67 MAP_ERROR(RequestDeviceWithUniqueOrigin, SecurityError, "requestDevice() called from sandboxed or otherwise unique origin."); 68 MAP_ERROR(RequestDeviceWithUniqueOrigin, SecurityError, "requestDevice() called from sandboxed or otherwise unique origin.");
68 MAP_ERROR(RequestDeviceWithoutFrame, SecurityError, "No window to show t he requestDevice() dialog."); 69 MAP_ERROR(RequestDeviceWithoutFrame, SecurityError, "No window to show t he requestDevice() dialog.");
69 70
70 #undef MAP_ERROR 71 #undef MAP_ERROR
71 } 72 }
72 73
73 ASSERT_NOT_REACHED(); 74 ASSERT_NOT_REACHED();
74 return DOMException::create(UnknownError); 75 return DOMException::create(UnknownError);
75 } 76 }
76 77
77 } // namespace blink 78 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698