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 WebBluetoothDevice_h | 5 #ifndef WebBluetoothDevice_h |
6 #define WebBluetoothDevice_h | 6 #define WebBluetoothDevice_h |
7 | 7 |
8 #include "WebString.h" | 8 #include "WebString.h" |
| 9 #include "WebVector.h" |
9 | 10 |
10 namespace blink { | 11 namespace blink { |
11 | 12 |
12 // Information describing a Bluetooth device provided by the platform. | 13 // Information describing a Bluetooth device provided by the platform. |
13 struct WebBluetoothDevice { | 14 struct WebBluetoothDevice { |
14 WebBluetoothDevice(const WebString& instanceId) | 15 enum class VendorIDSource { |
15 : instanceId(instanceId) | 16 Unknown, |
| 17 Bluetooth, |
| 18 USB |
| 19 }; |
| 20 |
| 21 // FIXME: Remove after crrev.com/885723002 lands. |
| 22 WebBluetoothDevice(const WebString& instanceID) |
| 23 : instanceID(instanceID) |
| 24 , deviceClass(0) |
| 25 , vendorIDSource(VendorIDSource::Unknown) |
| 26 , vendorID(0) |
| 27 , productID(0) |
| 28 , productVersion(0) |
| 29 , paired(false) |
| 30 , connected(false) |
| 31 , uuids() |
| 32 { |
| 33 } |
| 34 |
| 35 WebBluetoothDevice(const WebString& instanceID, |
| 36 const WebString& name, |
| 37 int32_t deviceClass, |
| 38 VendorIDSource vendorIDSource, |
| 39 uint16_t vendorID, |
| 40 uint16_t productID, |
| 41 uint16_t productVersion, |
| 42 bool paired, |
| 43 bool connected, |
| 44 const WebVector<WebString>& uuids) |
| 45 : instanceID(instanceID) |
| 46 , name(name) |
| 47 , deviceClass(deviceClass) |
| 48 , vendorIDSource(vendorIDSource) |
| 49 , vendorID(vendorID) |
| 50 , productID(productID) |
| 51 , productVersion(productVersion) |
| 52 , paired(paired) |
| 53 , connected(connected) |
| 54 , uuids(uuids) |
16 { | 55 { |
17 } | 56 } |
18 | 57 |
19 // Members corresponding to BluetoothDevice attributes as specified in IDL. | 58 // Members corresponding to BluetoothDevice attributes as specified in IDL. |
20 const WebString instanceId; | 59 const WebString instanceID; |
| 60 const WebString name; |
| 61 const int32_t deviceClass; |
| 62 const VendorIDSource vendorIDSource; |
| 63 const uint16_t vendorID; |
| 64 const uint16_t productID; |
| 65 const uint16_t productVersion; |
| 66 const bool paired; |
| 67 const bool connected; |
| 68 const WebVector<WebString> uuids; |
21 }; | 69 }; |
22 | 70 |
23 } // namespace blink | 71 } // namespace blink |
24 | 72 |
25 #endif // WebBluetoothDevice_h | 73 #endif // WebBluetoothDevice_h |
OLD | NEW |