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 DEVICE_BLUETOOTH_ADAPTER_H_ | 5 #ifndef DEVICE_BLUETOOTH_ADAPTER_H_ |
6 #define DEVICE_BLUETOOTH_ADAPTER_H_ | 6 #define DEVICE_BLUETOOTH_ADAPTER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "device/bluetooth/bluetooth_adapter.h" | 9 #include "device/bluetooth/bluetooth_adapter.h" |
10 #include "device/bluetooth/bluetooth_adapter_factory.h" | 10 #include "device/bluetooth/bluetooth_adapter_factory.h" |
11 #include "device/bluetooth/public/interfaces/adapter.mojom.h" | 11 #include "device/bluetooth/public/interfaces/adapter.mojom.h" |
12 | 12 |
13 namespace bluetooth { | 13 namespace bluetooth { |
14 | 14 |
15 // Implementation of Mojo BluetoothAdapter located in | 15 // Implementation of Mojo BluetoothAdapter located in |
16 // device/bluetooth/public/interfaces/bluetooth.mojom. | 16 // device/bluetooth/public/interfaces/bluetooth.mojom. |
17 // It handles requests for Bluetooth adapter capabilities | 17 // It handles requests for Bluetooth adapter capabilities |
18 // and devices and uses the platform abstraction of device/bluetooth. | 18 // and devices and uses the platform abstraction of device/bluetooth. |
19 class Adapter : public mojom::Adapter, | 19 class Adapter : public mojom::Adapter, |
20 public device::BluetoothAdapter::Observer { | 20 public device::BluetoothAdapter::Observer { |
21 public: | 21 public: |
22 Adapter(); | 22 Adapter(); |
23 ~Adapter() override; | 23 ~Adapter() override; |
24 | 24 |
25 // Creates an Adapter with a strong Mojo binding to |request|. | 25 // Creates an Adapter with a strong Mojo binding to |request|. |
26 static void Create(mojom::AdapterRequest request); | 26 static void Create(mojom::AdapterRequest request); |
27 | 27 |
28 // mojom::Adapter overrides: | 28 // mojom::Adapter overrides: |
| 29 void GetAddress(const GetAddressCallback& callback) override; |
| 30 void GetName(const GetNameCallback& callback) override; |
| 31 void IsPresent(const IsPresentCallback& callback) override; |
| 32 void IsPowered(const IsPoweredCallback& callback) override; |
29 void GetDevices(const GetDevicesCallback& callback) override; | 33 void GetDevices(const GetDevicesCallback& callback) override; |
30 void SetClient(mojom::AdapterClientPtr client) override; | 34 void SetClient(mojom::AdapterClientPtr client) override; |
31 | 35 |
32 // device::BluetoothAdapter::Observer overrides: | 36 // device::BluetoothAdapter::Observer overrides: |
33 void DeviceAdded(device::BluetoothAdapter* adapter, | 37 void DeviceAdded(device::BluetoothAdapter* adapter, |
34 device::BluetoothDevice* device) override; | 38 device::BluetoothDevice* device) override; |
35 void DeviceRemoved(device::BluetoothAdapter* adapter, | 39 void DeviceRemoved(device::BluetoothAdapter* adapter, |
36 device::BluetoothDevice* device) override; | 40 device::BluetoothDevice* device) override; |
37 | 41 |
38 private: | 42 private: |
(...skipping 17 matching lines...) Expand all Loading... |
56 mojom::AdapterClientPtr client_; | 60 mojom::AdapterClientPtr client_; |
57 | 61 |
58 base::WeakPtrFactory<Adapter> weak_ptr_factory_; | 62 base::WeakPtrFactory<Adapter> weak_ptr_factory_; |
59 | 63 |
60 DISALLOW_COPY_AND_ASSIGN(Adapter); | 64 DISALLOW_COPY_AND_ASSIGN(Adapter); |
61 }; | 65 }; |
62 | 66 |
63 } // namespace bluetooth | 67 } // namespace bluetooth |
64 | 68 |
65 #endif // DEVICE_BLUETOOTH_ADAPTER_H_ | 69 #endif // DEVICE_BLUETOOTH_ADAPTER_H_ |
OLD | NEW |