| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_ARC_BLUETOOTH_BLUETOOTH_STRUCT_TRAITS_H_ | 5 #ifndef COMPONENTS_ARC_BLUETOOTH_BLUETOOTH_STRUCT_TRAITS_H_ |
| 6 #define COMPONENTS_ARC_BLUETOOTH_BLUETOOTH_STRUCT_TRAITS_H_ | 6 #define COMPONENTS_ARC_BLUETOOTH_BLUETOOTH_STRUCT_TRAITS_H_ |
| 7 | 7 |
| 8 #include "components/arc/common/bluetooth.mojom.h" | 8 #include "components/arc/common/bluetooth.mojom.h" |
| 9 #include "device/bluetooth/bluetooth_advertisement.h" | |
| 10 #include "device/bluetooth/bluetooth_common.h" | 9 #include "device/bluetooth/bluetooth_common.h" |
| 11 #include "device/bluetooth/bluetooth_uuid.h" | |
| 12 #include "device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.h" | 10 #include "device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.h" |
| 13 | 11 |
| 14 namespace mojo { | 12 namespace mojo { |
| 15 | 13 |
| 16 template <> | 14 template <> |
| 17 struct EnumTraits<arc::mojom::BluetoothDeviceType, | 15 struct EnumTraits<arc::mojom::BluetoothDeviceType, |
| 18 device::BluetoothTransport> { | 16 device::BluetoothTransport> { |
| 19 static arc::mojom::BluetoothDeviceType ToMojom( | 17 static arc::mojom::BluetoothDeviceType ToMojom( |
| 20 device::BluetoothTransport type) { | 18 device::BluetoothTransport type) { |
| 21 switch (type) { | 19 switch (type) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 93 } |
| 96 }; | 94 }; |
| 97 | 95 |
| 98 template <> | 96 template <> |
| 99 struct StructTraits<arc::mojom::BluetoothUUIDDataView, device::BluetoothUUID> { | 97 struct StructTraits<arc::mojom::BluetoothUUIDDataView, device::BluetoothUUID> { |
| 100 static std::vector<uint8_t> uuid(const device::BluetoothUUID& input); | 98 static std::vector<uint8_t> uuid(const device::BluetoothUUID& input); |
| 101 static bool Read(arc::mojom::BluetoothUUIDDataView data, | 99 static bool Read(arc::mojom::BluetoothUUIDDataView data, |
| 102 device::BluetoothUUID* output); | 100 device::BluetoothUUID* output); |
| 103 }; | 101 }; |
| 104 | 102 |
| 105 template <> | |
| 106 struct StructTraits<arc::mojom::BluetoothAdvertisementDataView, | |
| 107 std::unique_ptr<device::BluetoothAdvertisement::Data>> { | |
| 108 static bool Read( | |
| 109 arc::mojom::BluetoothAdvertisementDataView advertisement, | |
| 110 std::unique_ptr<device::BluetoothAdvertisement::Data>* output); | |
| 111 | |
| 112 // Dummy methods. | |
| 113 static arc::mojom::BluetoothAdvertisementType type( | |
| 114 std::unique_ptr<device::BluetoothAdvertisement::Data>& input) { | |
| 115 NOTREACHED(); | |
| 116 return arc::mojom::BluetoothAdvertisementType::ADV_TYPE_NON_CONNECTABLE; | |
| 117 } | |
| 118 | |
| 119 static bool include_tx_power( | |
| 120 std::unique_ptr<device::BluetoothAdvertisement::Data>& input) { | |
| 121 NOTREACHED(); | |
| 122 return false; | |
| 123 } | |
| 124 | |
| 125 static mojo::Array<arc::mojom::BluetoothAdvertisingDataPtr> data( | |
| 126 std::unique_ptr<device::BluetoothAdvertisement::Data>& input) { | |
| 127 NOTREACHED(); | |
| 128 return mojo::Array<arc::mojom::BluetoothAdvertisingDataPtr>(); | |
| 129 } | |
| 130 }; | |
| 131 | |
| 132 } // namespace mojo | 103 } // namespace mojo |
| 133 | 104 |
| 134 #endif // COMPONENTS_ARC_BLUETOOTH_BLUETOOTH_STRUCT_TRAITS_H_ | 105 #endif // COMPONENTS_ARC_BLUETOOTH_BLUETOOTH_STRUCT_TRAITS_H_ |
| OLD | NEW |