OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BLUETOOTH_ADAPTER_CHROMEOS_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/sequenced_task_runner.h" | 14 #include "base/sequenced_task_runner.h" |
15 #include "chromeos/dbus/bluetooth_adapter_client.h" | 15 #include "chromeos/dbus/bluetooth_adapter_client.h" |
16 #include "chromeos/dbus/bluetooth_agent_service_provider.h" | 16 #include "chromeos/dbus/bluetooth_agent_service_provider.h" |
17 #include "chromeos/dbus/bluetooth_device_client.h" | 17 #include "chromeos/dbus/bluetooth_device_client.h" |
18 #include "chromeos/dbus/bluetooth_input_client.h" | 18 #include "chromeos/dbus/bluetooth_input_client.h" |
19 #include "dbus/object_path.h" | 19 #include "dbus/object_path.h" |
20 #include "device/bluetooth/bluetooth_adapter.h" | 20 #include "device/bluetooth/bluetooth_adapter.h" |
21 #include "device/bluetooth/bluetooth_audio_sink.h" | 21 #include "device/bluetooth/bluetooth_audio_sink.h" |
22 #include "device/bluetooth/bluetooth_audio_sink_chromeos.h" | |
armansito
2015/01/29 04:22:55
Is this include needed? I don't see that you're re
Miao
2015/01/29 23:58:38
Removed.
| |
22 #include "device/bluetooth/bluetooth_device.h" | 23 #include "device/bluetooth/bluetooth_device.h" |
23 #include "device/bluetooth/bluetooth_export.h" | 24 #include "device/bluetooth/bluetooth_export.h" |
24 | 25 |
25 namespace device { | 26 namespace device { |
26 class BluetoothSocketThread; | 27 class BluetoothSocketThread; |
27 } // namespace device | 28 } // namespace device |
28 | 29 |
29 namespace chromeos { | 30 namespace chromeos { |
30 | 31 |
32 class BluetoothAudioSinkChromeOS; | |
armansito
2015/01/29 04:22:55
Is this forward declaration needed, especially sin
Miao
2015/01/29 23:58:38
Removed.
| |
31 class BluetoothChromeOSTest; | 33 class BluetoothChromeOSTest; |
32 class BluetoothDeviceChromeOS; | 34 class BluetoothDeviceChromeOS; |
33 class BluetoothPairingChromeOS; | 35 class BluetoothPairingChromeOS; |
34 class BluetoothRemoteGattCharacteristicChromeOS; | 36 class BluetoothRemoteGattCharacteristicChromeOS; |
35 class BluetoothRemoteGattDescriptorChromeOS; | 37 class BluetoothRemoteGattDescriptorChromeOS; |
36 class BluetoothRemoteGattServiceChromeOS; | 38 class BluetoothRemoteGattServiceChromeOS; |
37 | 39 |
38 // The BluetoothAdapterChromeOS class implements BluetoothAdapter for the | 40 // The BluetoothAdapterChromeOS class implements BluetoothAdapter for the |
39 // Chrome OS platform. | 41 // Chrome OS platform. |
40 class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS | 42 class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 void OnRegisterAgent(); | 177 void OnRegisterAgent(); |
176 void OnRegisterAgentError(const std::string& error_name, | 178 void OnRegisterAgentError(const std::string& error_name, |
177 const std::string& error_message); | 179 const std::string& error_message); |
178 | 180 |
179 // Called by dbus:: on completion of the D-Bus method call to request that | 181 // Called by dbus:: on completion of the D-Bus method call to request that |
180 // the pairing agent be made the default. | 182 // the pairing agent be made the default. |
181 void OnRequestDefaultAgent(); | 183 void OnRequestDefaultAgent(); |
182 void OnRequestDefaultAgentError(const std::string& error_name, | 184 void OnRequestDefaultAgentError(const std::string& error_name, |
183 const std::string& error_message); | 185 const std::string& error_message); |
184 | 186 |
187 // Called by BluetoothAudioSinkChromeOS on completion of registering an audio | |
188 // sink. | |
189 void OnRegisterAudioSink( | |
190 const device::BluetoothAdapter::AcquiredCallback& callback, | |
191 scoped_refptr<device::BluetoothAudioSink> audio_sink); | |
192 | |
185 // Internal method to obtain a BluetoothPairingChromeOS object for the device | 193 // Internal method to obtain a BluetoothPairingChromeOS object for the device |
186 // with path |object_path|. Returns the existing pairing object if the device | 194 // with path |object_path|. Returns the existing pairing object if the device |
187 // already has one (usually an outgoing connection in progress) or a new | 195 // already has one (usually an outgoing connection in progress) or a new |
188 // pairing object with the default pairing delegate if not. If no default | 196 // pairing object with the default pairing delegate if not. If no default |
189 // pairing object exists, NULL will be returned. | 197 // pairing object exists, NULL will be returned. |
190 BluetoothPairingChromeOS* GetPairing(const dbus::ObjectPath& object_path); | 198 BluetoothPairingChromeOS* GetPairing(const dbus::ObjectPath& object_path); |
191 | 199 |
192 // Set the tracked adapter to the one in |object_path|, this object will | 200 // Set the tracked adapter to the one in |object_path|, this object will |
193 // subsequently operate on that adapter until it is removed. | 201 // subsequently operate on that adapter until it is removed. |
194 void SetAdapter(const dbus::ObjectPath& object_path); | 202 void SetAdapter(const dbus::ObjectPath& object_path); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
278 // Note: This should remain the last member so it'll be destroyed and | 286 // Note: This should remain the last member so it'll be destroyed and |
279 // invalidate its weak pointers before any other members are destroyed. | 287 // invalidate its weak pointers before any other members are destroyed. |
280 base::WeakPtrFactory<BluetoothAdapterChromeOS> weak_ptr_factory_; | 288 base::WeakPtrFactory<BluetoothAdapterChromeOS> weak_ptr_factory_; |
281 | 289 |
282 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterChromeOS); | 290 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterChromeOS); |
283 }; | 291 }; |
284 | 292 |
285 } // namespace chromeos | 293 } // namespace chromeos |
286 | 294 |
287 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ | 295 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ |
OLD | NEW |