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

Unified Diff: device/bluetooth/bluetooth_adapter_factory.h

Issue 180163009: chrome.bluetooth API improvements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address code review feedback. Created 6 years, 9 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 3b6a2c27ea5cbe417a46a3b8432c51d3d1b053c5..1f07140f942494b4d4da3ac7f4fd479d70c70eef 100644
--- a/device/bluetooth/bluetooth_adapter_factory.h
+++ b/device/bluetooth/bluetooth_adapter_factory.h
@@ -18,9 +18,14 @@ namespace device {
// adapter" which may change depending on availability.
class BluetoothAdapterFactory {
public:
+ typedef base::Callback<void(BluetoothAdapter* adapter)> AdapterInitializer;
typedef base::Callback<void(scoped_refptr<BluetoothAdapter> adapter)>
AdapterCallback;
+ // Sets a global initializer to run just after the default adapter instance is
+ // created.
+ static void SetAdapterInitializer(AdapterInitializer initializer);
+
// Returns true if the Bluetooth adapter is available for the current
// platform.
static bool IsBluetoothAdapterAvailable();
@@ -35,6 +40,9 @@ class BluetoothAdapterFactory {
// but may or may not have been initialized.
// It returns NULL if no adapter has been created at the time.
static scoped_refptr<BluetoothAdapter> MaybeGetAdapter();
+
+ private:
+ AdapterInitializer adapter_initializer_;
};
} // namespace device

Powered by Google App Engine
This is Rietveld 408576698