Chromium Code Reviews| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 | 181 |
| 182 // Returns a weak pointer to a new adapter. For platforms with asynchronous | 182 // Returns a weak pointer to a new adapter. For platforms with asynchronous |
| 183 // initialization, the returned adapter will run the |init_callback| once | 183 // initialization, the returned adapter will run the |init_callback| once |
| 184 // asynchronous initialization is complete. | 184 // asynchronous initialization is complete. |
| 185 // Caution: The returned pointer also transfers ownership of the adapter. The | 185 // Caution: The returned pointer also transfers ownership of the adapter. The |
| 186 // caller is expected to call |AddRef()| on the returned pointer, typically by | 186 // caller is expected to call |AddRef()| on the returned pointer, typically by |
| 187 // storing it into a |scoped_refptr|. | 187 // storing it into a |scoped_refptr|. |
| 188 static base::WeakPtr<BluetoothAdapter> CreateAdapter( | 188 static base::WeakPtr<BluetoothAdapter> CreateAdapter( |
| 189 const InitCallback& init_callback); | 189 const InitCallback& init_callback); |
| 190 | 190 |
| 191 // Shutdown the adapter, ending reliance on other objects, and resulting in | |
| 192 // |IsPresent| returning false. | |
| 193 virtual void Shutdown(); | |
|
armansito
2015/01/14 19:52:43
Again, should this just be a BluetoothAdapterChrom
scheib
2015/01/14 23:07:26
Done.
| |
| 194 | |
| 191 // Returns a weak pointer to an existing adapter for testing purposes only. | 195 // Returns a weak pointer to an existing adapter for testing purposes only. |
| 192 base::WeakPtr<BluetoothAdapter> GetWeakPtrForTesting(); | 196 base::WeakPtr<BluetoothAdapter> GetWeakPtrForTesting(); |
| 193 | 197 |
| 194 // Adds and removes observers for events on this bluetooth adapter. If | 198 // Adds and removes observers for events on this bluetooth adapter. If |
| 195 // monitoring multiple adapters, check the |adapter| parameter of observer | 199 // monitoring multiple adapters, check the |adapter| parameter of observer |
| 196 // methods to determine which adapter is issuing the event. | 200 // methods to determine which adapter is issuing the event. |
| 197 virtual void AddObserver(BluetoothAdapter::Observer* observer) = 0; | 201 virtual void AddObserver(BluetoothAdapter::Observer* observer) = 0; |
| 198 virtual void RemoveObserver( | 202 virtual void RemoveObserver( |
| 199 BluetoothAdapter::Observer* observer) = 0; | 203 BluetoothAdapter::Observer* observer) = 0; |
| 200 | 204 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 430 // Trait for RefCountedThreadSafe that deletes BluetoothAdapter. | 434 // Trait for RefCountedThreadSafe that deletes BluetoothAdapter. |
| 431 struct BluetoothAdapterDeleter { | 435 struct BluetoothAdapterDeleter { |
| 432 static void Destruct(const BluetoothAdapter* adapter) { | 436 static void Destruct(const BluetoothAdapter* adapter) { |
| 433 adapter->DeleteOnCorrectThread(); | 437 adapter->DeleteOnCorrectThread(); |
| 434 } | 438 } |
| 435 }; | 439 }; |
| 436 | 440 |
| 437 } // namespace device | 441 } // namespace device |
| 438 | 442 |
| 439 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 443 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
| OLD | NEW |