| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <utility> | 12 #include <utility> |
| 13 | 13 |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "device/bluetooth/bluetooth_device.h" | 17 #include "device/bluetooth/bluetooth_device.h" |
| 18 #include "device/bluetooth/bluetooth_export.h" |
| 18 | 19 |
| 19 namespace device { | 20 namespace device { |
| 20 | 21 |
| 21 class BluetoothDiscoverySession; | 22 class BluetoothDiscoverySession; |
| 22 class BluetoothGattCharacteristic; | 23 class BluetoothGattCharacteristic; |
| 23 class BluetoothGattDescriptor; | 24 class BluetoothGattDescriptor; |
| 24 class BluetoothGattService; | 25 class BluetoothGattService; |
| 25 class BluetoothSocket; | 26 class BluetoothSocket; |
| 26 class BluetoothUUID; | 27 class BluetoothUUID; |
| 27 | 28 |
| 28 // BluetoothAdapter represents a local Bluetooth adapter which may be used to | 29 // BluetoothAdapter represents a local Bluetooth adapter which may be used to |
| 29 // interact with remote Bluetooth devices. As well as providing support for | 30 // interact with remote Bluetooth devices. As well as providing support for |
| 30 // determining whether an adapter is present and whether the radio is powered, | 31 // determining whether an adapter is present and whether the radio is powered, |
| 31 // this class also provides support for obtaining the list of remote devices | 32 // this class also provides support for obtaining the list of remote devices |
| 32 // known to the adapter, discovering new devices, and providing notification of | 33 // known to the adapter, discovering new devices, and providing notification of |
| 33 // updates to device information. | 34 // updates to device information. |
| 34 class BluetoothAdapter : public base::RefCounted<BluetoothAdapter> { | 35 class DEVICE_BLUETOOTH_EXPORT BluetoothAdapter |
| 36 : public base::RefCounted<BluetoothAdapter> { |
| 35 public: | 37 public: |
| 36 // Interface for observing changes from bluetooth adapters. | 38 // Interface for observing changes from bluetooth adapters. |
| 37 class Observer { | 39 class Observer { |
| 38 public: | 40 public: |
| 39 virtual ~Observer() {} | 41 virtual ~Observer() {} |
| 40 | 42 |
| 41 // Called when the presence of the adapter |adapter| changes. When |present| | 43 // Called when the presence of the adapter |adapter| changes. When |present| |
| 42 // is true the adapter is now present, false means the adapter has been | 44 // is true the adapter is now present, false means the adapter has been |
| 43 // removed from the system. | 45 // removed from the system. |
| 44 virtual void AdapterPresentChanged(BluetoothAdapter* adapter, | 46 virtual void AdapterPresentChanged(BluetoothAdapter* adapter, |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 std::set<BluetoothDiscoverySession*> discovery_sessions_; | 416 std::set<BluetoothDiscoverySession*> discovery_sessions_; |
| 415 | 417 |
| 416 // Note: This should remain the last member so it'll be destroyed and | 418 // Note: This should remain the last member so it'll be destroyed and |
| 417 // invalidate its weak pointers before any other members are destroyed. | 419 // invalidate its weak pointers before any other members are destroyed. |
| 418 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; | 420 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; |
| 419 }; | 421 }; |
| 420 | 422 |
| 421 } // namespace device | 423 } // namespace device |
| 422 | 424 |
| 423 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 425 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
| OLD | NEW |