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 // Messages for Web Bluetooth API. | 5 // Messages for Web Bluetooth API. |
6 // Multiply-included message file, hence no include guard. | 6 // Multiply-included message file, hence no include guard. |
7 | 7 |
8 // Web Bluetooth Security | 8 // Web Bluetooth Security |
9 // The security mechanisms of Bluetooth are described in the specification: | 9 // The security mechanisms of Bluetooth are described in the specification: |
10 // https://webbluetoothcg.github.io/web-bluetooth | 10 // https://webbluetoothcg.github.io/web-bluetooth |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // access to it is closed. Or the UA might provide a revocation UI that allows | 49 // access to it is closed. Or the UA might provide a revocation UI that allows |
50 // the user to explicitly remove a device even while a tab is actively using | 50 // the user to explicitly remove a device even while a tab is actively using |
51 // that device. If a device is removed from this list while a Promise is pending | 51 // that device. If a device is removed from this list while a Promise is pending |
52 // to do something with the device, it must be treated the same as if the device | 52 // to do something with the device, it must be treated the same as if the device |
53 // moved out of Bluetooth range. | 53 // moved out of Bluetooth range. |
54 // """ | 54 // """ |
55 // | 55 // |
56 // From: Device Discovery: requestDevice | 56 // From: Device Discovery: requestDevice |
57 // http://webbluetoothcg.github.io/web-bluetooth/#device-discovery | 57 // http://webbluetoothcg.github.io/web-bluetooth/#device-discovery |
58 // """ | 58 // """ |
59 // Display a prompt to the user requesting that the user specify some devices | 59 // Even if scanResult is empty, display a prompt to the user requesting that the |
60 // from the result of the scan. The UA should show the user the human-readable | 60 // user select a device from it. The UA should show the user the human-readable |
61 // name of each device. If this name is not available because the UA's Bluetooth | 61 // name of each device. If this name is not available because the UA's Bluetooth |
62 // system doesn't support privacy-enabled scans, the UA should allow the user to | 62 // system doesn't support privacy-enabled scans, the UA should allow the user to |
63 // indicate interest and then perform a privacy-disabled scan to retrieve the | 63 // indicate interest and then perform a privacy-disabled scan to retrieve the |
64 // name. | 64 // name. |
65 // | 65 // |
66 // The UA may allow the user to select a nearby device that does not match | 66 // The UA may allow the user to select a nearby device that does not match |
67 // filters. | 67 // filters. |
68 // | 68 // |
69 // Wait for the user to have made their selection. | 69 // Wait for the user to have selected a device or cancelled the prompt. |
70 // | 70 // |
71 // If the user cancels the prompt, reject the Promise with a NotFoundError and | 71 // If the user cancels the prompt, reject promise with a NotFoundError and abort |
72 // abort these steps. | 72 // these steps. |
73 // | 73 // |
74 // Record the selected device in the origin's allowed devices list and the union | 74 // Add device to the origin's allowed devices map. with the union of the service |
75 // of the service UUIDs from filters and options.optionalServices in the device | 75 // UUIDs from filters and options.optionalServices as allowed services. |
76 // and origin's allowed services list. | |
77 // | 76 // |
78 // Connect to the device. ([BLUETOOTH41] 3.G.6.2.1) If the connection fails, | 77 // Get the BluetoothDevice representing device and resolve promise with the |
79 // reject the Promise with a NetworkError and abort these steps. | 78 // result. |
80 // | |
81 // Resolve the Promise with a BluetoothDevice instance representing the selected | |
82 // device. | |
83 // """ | 79 // """ |
84 | 80 |
85 #include "ipc/ipc_message_macros.h" | 81 #include "ipc/ipc_message_macros.h" |
86 #include "content/common/bluetooth/bluetooth_device.h" | 82 #include "content/common/bluetooth/bluetooth_device.h" |
87 #include "content/common/bluetooth/bluetooth_error.h" | 83 #include "content/common/bluetooth/bluetooth_error.h" |
88 | 84 |
89 #define IPC_MESSAGE_START BluetoothMsgStart | 85 #define IPC_MESSAGE_START BluetoothMsgStart |
90 | 86 |
91 IPC_ENUM_TRAITS_MAX_VALUE( | 87 IPC_ENUM_TRAITS_MAX_VALUE( |
92 device::BluetoothDevice::VendorIDSource, | 88 device::BluetoothDevice::VendorIDSource, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // Connects to a bluetooth device. | 139 // Connects to a bluetooth device. |
144 IPC_MESSAGE_CONTROL3(BluetoothHostMsg_ConnectGATT, | 140 IPC_MESSAGE_CONTROL3(BluetoothHostMsg_ConnectGATT, |
145 int /* thread_id */, | 141 int /* thread_id */, |
146 int /* request_id */, | 142 int /* request_id */, |
147 std::string /* device_instance_id */) | 143 std::string /* device_instance_id */) |
148 | 144 |
149 // Configures the mock data set in the browser used while under test. | 145 // Configures the mock data set in the browser used while under test. |
150 // TODO(scheib): Disable testing in non-test executables. crbug.com/436284. | 146 // TODO(scheib): Disable testing in non-test executables. crbug.com/436284. |
151 IPC_MESSAGE_CONTROL1(BluetoothHostMsg_SetBluetoothMockDataSetForTesting, | 147 IPC_MESSAGE_CONTROL1(BluetoothHostMsg_SetBluetoothMockDataSetForTesting, |
152 std::string /* name */) | 148 std::string /* name */) |
OLD | NEW |