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_ARC_BLUETOOTH_BRIDGE_H_ | 5 #ifndef COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ |
6 #define COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ | 6 #define COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/callback.h" | 15 #include "base/callback.h" |
16 #include "components/arc/arc_bridge_service.h" | 16 #include "components/arc/arc_bridge_service.h" |
17 #include "components/arc/arc_service.h" | 17 #include "components/arc/arc_service.h" |
18 #include "components/arc/common/bluetooth.mojom.h" | 18 #include "components/arc/common/bluetooth.mojom.h" |
19 #include "device/bluetooth/bluetooth_adapter.h" | 19 #include "device/bluetooth/bluetooth_adapter.h" |
20 #include "device/bluetooth/bluetooth_adapter_factory.h" | 20 #include "device/bluetooth/bluetooth_adapter_factory.h" |
21 #include "device/bluetooth/bluetooth_device.h" | 21 #include "device/bluetooth/bluetooth_device.h" |
22 #include "device/bluetooth/bluetooth_discovery_session.h" | 22 #include "device/bluetooth/bluetooth_discovery_session.h" |
23 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h" | 23 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h" |
24 #include "device/bluetooth/bluetooth_remote_gatt_descriptor.h" | 24 #include "device/bluetooth/bluetooth_remote_gatt_descriptor.h" |
25 #include "device/bluetooth/bluetooth_remote_gatt_service.h" | 25 #include "device/bluetooth/bluetooth_remote_gatt_service.h" |
| 26 #include "device/bluetooth/bluez/bluetooth_adapter_bluez.h" |
26 #include "mojo/public/cpp/bindings/binding.h" | 27 #include "mojo/public/cpp/bindings/binding.h" |
27 | 28 |
28 namespace arc { | 29 namespace arc { |
29 | 30 |
30 class ArcBridgeService; | 31 class ArcBridgeService; |
31 | 32 |
32 class ArcBluetoothBridge | 33 class ArcBluetoothBridge |
33 : public ArcService, | 34 : public ArcService, |
34 public ArcBridgeService::Observer, | 35 public ArcBridgeService::Observer, |
35 public device::BluetoothAdapter::Observer, | 36 public device::BluetoothAdapter::Observer, |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 mojom::BluetoothAddressPtr remote_addr, | 277 mojom::BluetoothAddressPtr remote_addr, |
277 mojom::BluetoothGattServiceIDPtr service_id, | 278 mojom::BluetoothGattServiceIDPtr service_id, |
278 mojom::BluetoothGattIDPtr char_id, | 279 mojom::BluetoothGattIDPtr char_id, |
279 mojom::BluetoothGattIDPtr desc_id) const; | 280 mojom::BluetoothGattIDPtr desc_id) const; |
280 | 281 |
281 // Propagates the list of paired device to Android. | 282 // Propagates the list of paired device to Android. |
282 void SendCachedPairedDevices() const; | 283 void SendCachedPairedDevices() const; |
283 | 284 |
284 mojo::Binding<mojom::BluetoothHost> binding_; | 285 mojo::Binding<mojom::BluetoothHost> binding_; |
285 | 286 |
286 scoped_refptr<device::BluetoothAdapter> bluetooth_adapter_; | 287 scoped_refptr<bluez::BluetoothAdapterBlueZ> bluetooth_adapter_; |
287 scoped_refptr<device::BluetoothAdvertisement> advertisment_; | 288 scoped_refptr<device::BluetoothAdvertisement> advertisment_; |
288 std::unique_ptr<device::BluetoothDiscoverySession> discovery_session_; | 289 std::unique_ptr<device::BluetoothDiscoverySession> discovery_session_; |
289 std::map<std::string, std::unique_ptr<device::BluetoothGattNotifySession>> | 290 std::map<std::string, std::unique_ptr<device::BluetoothGattNotifySession>> |
290 notification_session_; | 291 notification_session_; |
291 | 292 |
292 // WeakPtrFactory to use for callbacks. | 293 // WeakPtrFactory to use for callbacks. |
293 base::WeakPtrFactory<ArcBluetoothBridge> weak_factory_; | 294 base::WeakPtrFactory<ArcBluetoothBridge> weak_factory_; |
294 | 295 |
295 DISALLOW_COPY_AND_ASSIGN(ArcBluetoothBridge); | 296 DISALLOW_COPY_AND_ASSIGN(ArcBluetoothBridge); |
296 }; | 297 }; |
297 | 298 |
298 } // namespace arc | 299 } // namespace arc |
299 | 300 |
300 #endif // COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ | 301 #endif // COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ |
OLD | NEW |