| 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 #ifndef WebBluetooth_h | 5 #ifndef WebBluetooth_h |
| 6 #define WebBluetooth_h | 6 #define WebBluetooth_h |
| 7 | 7 |
| 8 #include "public/platform/WebCallbacks.h" | 8 #include "public/platform/WebCallbacks.h" |
| 9 #include "public/platform/WebString.h" | 9 #include "public/platform/WebString.h" |
| 10 #include "public/platform/WebVector.h" | 10 #include "public/platform/WebVector.h" |
| 11 #include "public/platform/modules/bluetooth/WebBluetoothError.h" | 11 #include "public/platform/modules/bluetooth/WebBluetoothError.h" |
| 12 #include "public/platform/modules/bluetooth/web_bluetooth.mojom.h" | 12 #include "public/platform/modules/bluetooth/web_bluetooth.mojom.h" |
| 13 | 13 |
| 14 #include <memory> | 14 #include <memory> |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 class WebBluetoothDevice; |
| 18 class WebBluetoothRemoteGATTCharacteristic; | 19 class WebBluetoothRemoteGATTCharacteristic; |
| 19 | 20 |
| 20 struct WebBluetoothDeviceInit; | 21 struct WebBluetoothDeviceInit; |
| 21 struct WebBluetoothRemoteGATTCharacteristicInit; | 22 struct WebBluetoothRemoteGATTCharacteristicInit; |
| 22 struct WebBluetoothRemoteGATTService; | 23 struct WebBluetoothRemoteGATTService; |
| 23 struct WebRequestDeviceOptions; | 24 struct WebRequestDeviceOptions; |
| 24 | 25 |
| 25 // Success and failure callbacks for requestDevice. | 26 // Success and failure callbacks for requestDevice. |
| 26 using WebBluetoothRequestDeviceCallbacks = WebCallbacks<std::unique_ptr<WebBluet
oothDeviceInit>, const WebBluetoothError&>; | 27 using WebBluetoothRequestDeviceCallbacks = WebCallbacks<std::unique_ptr<WebBluet
oothDeviceInit>, const WebBluetoothError&>; |
| 27 | 28 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 51 // Bluetooth Methods: | 52 // Bluetooth Methods: |
| 52 // See https://webbluetoothchrome.github.io/web-bluetooth/#device-discovery | 53 // See https://webbluetoothchrome.github.io/web-bluetooth/#device-discovery |
| 53 // WebBluetoothRequestDeviceCallbacks ownership transferred to the client. | 54 // WebBluetoothRequestDeviceCallbacks ownership transferred to the client. |
| 54 virtual void requestDevice(const WebRequestDeviceOptions&, WebBluetoothReque
stDeviceCallbacks*) { } | 55 virtual void requestDevice(const WebRequestDeviceOptions&, WebBluetoothReque
stDeviceCallbacks*) { } |
| 55 | 56 |
| 56 // BluetoothDevice methods: | 57 // BluetoothDevice methods: |
| 57 | 58 |
| 58 // BluetoothRemoteGATTServer methods: | 59 // BluetoothRemoteGATTServer methods: |
| 59 // See https://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetooth
gattremoteserver | 60 // See https://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetooth
gattremoteserver |
| 60 virtual void connect(const WebString& deviceId, | 61 virtual void connect(const WebString& deviceId, |
| 61 WebBluetoothRemoteGATTServerConnectCallbacks*) { } | 62 WebBluetoothDevice* device, |
| 63 WebBluetoothRemoteGATTServerConnectCallbacks*) {} |
| 62 virtual void disconnect(const WebString& deviceId) = 0; | 64 virtual void disconnect(const WebString& deviceId) = 0; |
| 63 virtual void getPrimaryService(const WebString& deviceId, | 65 virtual void getPrimaryService(const WebString& deviceId, |
| 64 const WebString& serviceUUID, | 66 const WebString& serviceUUID, |
| 65 WebBluetoothGetPrimaryServiceCallbacks*) { } | 67 WebBluetoothGetPrimaryServiceCallbacks*) { } |
| 66 // virtual void getPrimaryServices() { } | 68 // virtual void getPrimaryServices() { } |
| 67 | 69 |
| 68 // BluetoothRemoteGATTService methods: | 70 // BluetoothRemoteGATTService methods: |
| 69 // See https://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetooth
gattservice | 71 // See https://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetooth
gattservice |
| 70 virtual void getCharacteristics(const WebString& serviceInstanceID, | 72 virtual void getCharacteristics(const WebString& serviceInstanceID, |
| 71 mojom::WebBluetoothGATTQueryQuantity, | 73 mojom::WebBluetoothGATTQueryQuantity, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 89 const WebString& characteristicInstanceID, | 91 const WebString& characteristicInstanceID, |
| 90 WebBluetoothRemoteGATTCharacteristic*) = 0; | 92 WebBluetoothRemoteGATTCharacteristic*) = 0; |
| 91 virtual void characteristicObjectRemoved( | 93 virtual void characteristicObjectRemoved( |
| 92 const WebString& characteristicInstanceID, | 94 const WebString& characteristicInstanceID, |
| 93 WebBluetoothRemoteGATTCharacteristic*) {} | 95 WebBluetoothRemoteGATTCharacteristic*) {} |
| 94 }; | 96 }; |
| 95 | 97 |
| 96 } // namespace blink | 98 } // namespace blink |
| 97 | 99 |
| 98 #endif // WebBluetooth_h | 100 #endif // WebBluetooth_h |
| OLD | NEW |