| 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> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // BluetoothAdapter represents a local Bluetooth adapter which may be used to | 34 // BluetoothAdapter represents a local Bluetooth adapter which may be used to |
| 35 // interact with remote Bluetooth devices. As well as providing support for | 35 // interact with remote Bluetooth devices. As well as providing support for |
| 36 // determining whether an adapter is present and whether the radio is powered, | 36 // determining whether an adapter is present and whether the radio is powered, |
| 37 // this class also provides support for obtaining the list of remote devices | 37 // this class also provides support for obtaining the list of remote devices |
| 38 // known to the adapter, discovering new devices, and providing notification of | 38 // known to the adapter, discovering new devices, and providing notification of |
| 39 // updates to device information. | 39 // updates to device information. |
| 40 class DEVICE_BLUETOOTH_EXPORT BluetoothAdapter | 40 class DEVICE_BLUETOOTH_EXPORT BluetoothAdapter |
| 41 : public base::RefCounted<BluetoothAdapter> { | 41 : public base::RefCounted<BluetoothAdapter> { |
| 42 public: | 42 public: |
| 43 // Interface for observing changes from bluetooth adapters. | 43 // Interface for observing changes from bluetooth adapters. |
| 44 class Observer { | 44 class DEVICE_BLUETOOTH_EXPORT Observer { |
| 45 public: | 45 public: |
| 46 virtual ~Observer() {} | 46 virtual ~Observer() {} |
| 47 | 47 |
| 48 // Called when the presence of the adapter |adapter| changes. When |present| | 48 // Called when the presence of the adapter |adapter| changes. When |present| |
| 49 // is true the adapter is now present, false means the adapter has been | 49 // is true the adapter is now present, false means the adapter has been |
| 50 // removed from the system. | 50 // removed from the system. |
| 51 virtual void AdapterPresentChanged(BluetoothAdapter* adapter, | 51 virtual void AdapterPresentChanged(BluetoothAdapter* adapter, |
| 52 bool present) {} | 52 bool present) {} |
| 53 | 53 |
| 54 // Called when the radio power state of the adapter |adapter| changes. When | 54 // Called when the radio power state of the adapter |adapter| changes. When |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 std::set<BluetoothDiscoverySession*> discovery_sessions_; | 488 std::set<BluetoothDiscoverySession*> discovery_sessions_; |
| 489 | 489 |
| 490 // Note: This should remain the last member so it'll be destroyed and | 490 // Note: This should remain the last member so it'll be destroyed and |
| 491 // invalidate its weak pointers before any other members are destroyed. | 491 // invalidate its weak pointers before any other members are destroyed. |
| 492 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; | 492 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; |
| 493 }; | 493 }; |
| 494 | 494 |
| 495 } // namespace device | 495 } // namespace device |
| 496 | 496 |
| 497 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 497 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
| OLD | NEW |