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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 const InitCallback& init_callback); | 190 const InitCallback& init_callback); |
191 | 191 |
192 // Returns a weak pointer to an existing adapter for testing purposes only. | 192 // Returns a weak pointer to an existing adapter for testing purposes only. |
193 base::WeakPtr<BluetoothAdapter> GetWeakPtrForTesting(); | 193 base::WeakPtr<BluetoothAdapter> GetWeakPtrForTesting(); |
194 | 194 |
195 #if defined(OS_CHROMEOS) | 195 #if defined(OS_CHROMEOS) |
196 // Shutdown the adapter: tear down and clean up all objects owned by | 196 // Shutdown the adapter: tear down and clean up all objects owned by |
197 // BluetoothAdapter. After this call, the BluetoothAdapter will behave as if | 197 // BluetoothAdapter. After this call, the BluetoothAdapter will behave as if |
198 // no Bluetooth controller exists in the local system. |IsPresent| will return | 198 // no Bluetooth controller exists in the local system. |IsPresent| will return |
199 // false. | 199 // false. |
200 void Shutdown(); | 200 virtual void Shutdown(); |
201 #endif | 201 #endif |
202 | 202 |
203 // Adds and removes observers for events on this bluetooth adapter. If | 203 // Adds and removes observers for events on this bluetooth adapter. If |
204 // monitoring multiple adapters, check the |adapter| parameter of observer | 204 // monitoring multiple adapters, check the |adapter| parameter of observer |
205 // methods to determine which adapter is issuing the event. | 205 // methods to determine which adapter is issuing the event. |
206 virtual void AddObserver(BluetoothAdapter::Observer* observer) = 0; | 206 virtual void AddObserver(BluetoothAdapter::Observer* observer) = 0; |
207 virtual void RemoveObserver( | 207 virtual void RemoveObserver( |
208 BluetoothAdapter::Observer* observer) = 0; | 208 BluetoothAdapter::Observer* observer) = 0; |
209 | 209 |
210 // The address of this adapter. The address format is "XX:XX:XX:XX:XX:XX", | 210 // The address of this adapter. The address format is "XX:XX:XX:XX:XX:XX", |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 // Trait for RefCountedThreadSafe that deletes BluetoothAdapter. | 451 // Trait for RefCountedThreadSafe that deletes BluetoothAdapter. |
452 struct BluetoothAdapterDeleter { | 452 struct BluetoothAdapterDeleter { |
453 static void Destruct(const BluetoothAdapter* adapter) { | 453 static void Destruct(const BluetoothAdapter* adapter) { |
454 adapter->DeleteOnCorrectThread(); | 454 adapter->DeleteOnCorrectThread(); |
455 } | 455 } |
456 }; | 456 }; |
457 | 457 |
458 } // namespace device | 458 } // namespace device |
459 | 459 |
460 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 460 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
OLD | NEW |