Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Unified Diff: device/bluetooth/bluetooth_adapter_factory.cc

Issue 11819007: Changed DefaultAdapter to RunCallbackOnAdapterReady function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed device_unittests. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_adapter_factory.cc
diff --git a/device/bluetooth/bluetooth_adapter_factory.cc b/device/bluetooth/bluetooth_adapter_factory.cc
index 03d633f47c2d40f63822339d6801bd831c08eee8..8aa4b7e6ef9d6f1ce8520c491bd2c98665a127cb 100644
--- a/device/bluetooth/bluetooth_adapter_factory.cc
+++ b/device/bluetooth/bluetooth_adapter_factory.cc
@@ -27,7 +27,16 @@ base::LazyInstance<base::WeakPtr<device::BluetoothAdapter> >::Leaky
namespace device {
// static
-scoped_refptr<BluetoothAdapter> BluetoothAdapterFactory::DefaultAdapter() {
+bool BluetoothAdapterFactory::IsBluetoothSupported() {
+#if defined(OS_CHROMEOS)
+ return true;
+#endif
+ return false;
+}
+
+// static
+void BluetoothAdapterFactory::RunCallbackOnAdapterReady(
+ const AdapterCallback& callback) {
if (!default_adapter.Get().get()) {
#if defined(OS_CHROMEOS)
chromeos::BluetoothAdapterChromeOs* new_adapter =
@@ -37,6 +46,11 @@ scoped_refptr<BluetoothAdapter> BluetoothAdapterFactory::DefaultAdapter() {
#endif
}
+ callback.Run(scoped_refptr<BluetoothAdapter>(default_adapter.Get()));
+}
+
+// static
+scoped_refptr<BluetoothAdapter> BluetoothAdapterFactory::GetAdapter() {
return scoped_refptr<BluetoothAdapter>(default_adapter.Get());
}

Powered by Google App Engine
This is Rietveld 408576698