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

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: 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..44e3fbd5f4061ce253e8ccd0bd010989afbe5124 100644
--- a/device/bluetooth/bluetooth_adapter_factory.cc
+++ b/device/bluetooth/bluetooth_adapter_factory.cc
@@ -27,7 +27,17 @@ base::LazyInstance<base::WeakPtr<device::BluetoothAdapter> >::Leaky
namespace device {
// static
-scoped_refptr<BluetoothAdapter> BluetoothAdapterFactory::DefaultAdapter() {
+bool BluetoothAdapterFactory::IsBluetoothSupported() {
+ bool is_bluetooth_supported = false;
+#if defined(OS_CHROMEOS)
+ is_bluetooth_supported = true;
+#endif
+ return is_bluetooth_supported;
bryeung 2013/01/08 22:24:27 any reason not to write this as: #if defined(OS_C
youngki 2013/01/09 15:12:03 Done.
+}
+
+// static
+void BluetoothAdapterFactory::RunCallbackOnAdapterReady(
+ const AdapterCallback& callback) {
if (!default_adapter.Get().get()) {
#if defined(OS_CHROMEOS)
chromeos::BluetoothAdapterChromeOs* new_adapter =
@@ -37,6 +47,12 @@ scoped_refptr<BluetoothAdapter> BluetoothAdapterFactory::DefaultAdapter() {
#endif
}
+ if (default_adapter.Get().get())
+ callback.Run(scoped_refptr<BluetoothAdapter>(default_adapter.Get()));
+}
+
+// static
+scoped_refptr<BluetoothAdapter> BluetoothAdapterFactory::GetAdapter() {
return scoped_refptr<BluetoothAdapter>(default_adapter.Get());
}
« device/bluetooth/bluetooth_adapter_factory.h ('K') | « device/bluetooth/bluetooth_adapter_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698