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

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 IsBluetoothSupported in BluetoothEventRouter to fix browser_tests. 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
« no previous file with comments | « device/bluetooth/bluetooth_adapter_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2e8dac0ae778ed43487e18ebeecd3f67b023669a 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::IsBluetoothAdapterAvailable() {
+#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());
}
« no previous file with comments | « device/bluetooth/bluetooth_adapter_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698