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

Unified Diff: device/bluetooth/bluetooth_adapter_factory.h

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.h
diff --git a/device/bluetooth/bluetooth_adapter_factory.h b/device/bluetooth/bluetooth_adapter_factory.h
index 82e1e6f90eb4396d276fd2c7351183cd21ef0da7..f5c816f7c1b40ab23982abf40ebac5be07ecdb73 100644
--- a/device/bluetooth/bluetooth_adapter_factory.h
+++ b/device/bluetooth/bluetooth_adapter_factory.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/callback.h"
#include "base/memory/ref_counted.h"
namespace device {
@@ -18,11 +19,19 @@ class BluetoothAdapter;
// adapter" which may change depending on availability.
class BluetoothAdapterFactory {
public:
- // Returns the shared instance for the default adapter, whichever that may
- // be at the time. Check the returned scoped_refptr does not point to NULL and
- // use IsPresent() and the AdapterPresentChanged() observer method to
- // determine whether an adapter is actually available or not.
- static scoped_refptr<BluetoothAdapter> DefaultAdapter();
+ typedef base::Callback<bool(scoped_refptr<device::BluetoothAdapter> adapter)>
+ AdapterCallback;
+
+ // Returns true if the bluetooth is supported in the current platform.
bryeung 2013/01/08 22:24:27 s/if the bluetooth/if Bluetooth/
youngki 2013/01/09 15:12:03 Done.
+ static bool IsBluetoothSupported();
+
+ // Runs the callback with the shared instance for the default adapter when the
+ // adapter is available to be used.
+ static void RunCallbackOnAdapterReady(const AdapterCallback& callback);
+
+ // Returns the shared instance of the adapter that has already been created.
+ // It returns NULL if no adapter has been created at the time.
+ static scoped_refptr<BluetoothAdapter> GetAdapter();
// Creates an instance for a specific adapter at address |address|.
static BluetoothAdapter* Create(const std::string& address);

Powered by Google App Engine
This is Rietveld 408576698