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_FACTORY_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_FACTORY_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_FACTORY_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "device/bluetooth/bluetooth_adapter.h" | 10 #include "device/bluetooth/bluetooth_adapter.h" |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 // Returns true if the Bluetooth adapter is available for the current | 22 // Returns true if the Bluetooth adapter is available for the current |
| 23 // platform. | 23 // platform. |
| 24 static bool IsBluetoothAdapterAvailable(); | 24 static bool IsBluetoothAdapterAvailable(); |
| 25 | 25 |
| 26 // Returns the shared instance of the default adapter, creating and | 26 // Returns the shared instance of the default adapter, creating and |
| 27 // initializing it if necessary. |callback| is called with the adapter | 27 // initializing it if necessary. |callback| is called with the adapter |
| 28 // instance passed only once the adapter is fully initialized and ready to | 28 // instance passed only once the adapter is fully initialized and ready to |
| 29 // use. | 29 // use. |
| 30 static void GetAdapter(const AdapterCallback& callback); | 30 static void GetAdapter(const AdapterCallback& callback); |
| 31 | 31 |
| 32 #if defined(OS_CHROMEOS) | |
| 33 // Shutdown the adapter, ending reliance DBusThreadManager, and resulting in | |
|
armansito
2015/01/14 23:49:47
nit: I would make this a bit more descriptive, may
scheib
2015/01/15 00:03:40
Done.
| |
| 34 // the adapter's |IsPresent| returning false. | |
| 35 static void OnDBusThreadManagerShutdown(); | |
| 36 #endif | |
| 37 | |
| 32 // Sets the shared instance of the default adapter for testing purposes only, | 38 // Sets the shared instance of the default adapter for testing purposes only, |
| 33 // no reference is retained after completion of the call, removing the last | 39 // no reference is retained after completion of the call, removing the last |
| 34 // reference will reset the factory. | 40 // reference will reset the factory. |
| 35 static void SetAdapterForTesting(scoped_refptr<BluetoothAdapter> adapter); | 41 static void SetAdapterForTesting(scoped_refptr<BluetoothAdapter> adapter); |
| 36 | 42 |
| 37 // Returns true iff the implementation has a (non-NULL) shared instance of the | 43 // Returns true iff the implementation has a (non-NULL) shared instance of the |
| 38 // adapter. Exposed for testing. | 44 // adapter. Exposed for testing. |
| 39 static bool HasSharedInstanceForTesting(); | 45 static bool HasSharedInstanceForTesting(); |
| 40 }; | 46 }; |
| 41 | 47 |
| 42 } // namespace device | 48 } // namespace device |
| 43 | 49 |
| 44 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_FACTORY_H_ | 50 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_FACTORY_H_ |
| OLD | NEW |