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

Unified Diff: chrome/browser/extensions/api/bluetooth/bluetooth_event_router.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: chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h
diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h b/chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h
index b93858acd9943e434d52af68d934e05f268c9b89..df83be2825302432a15bfa6813dd5b5110bb1e2f 100644
--- a/chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h
+++ b/chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h
@@ -11,6 +11,7 @@
#include "base/memory/scoped_vector.h"
#include "chrome/common/extensions/api/bluetooth.h"
#include "device/bluetooth/bluetooth_adapter.h"
+#include "device/bluetooth/bluetooth_adapter_factory.h"
#include "device/bluetooth/bluetooth_socket.h"
class Profile;
@@ -23,9 +24,10 @@ class ExtensionBluetoothEventRouter
explicit ExtensionBluetoothEventRouter(Profile* profile);
virtual ~ExtensionBluetoothEventRouter();
- // GetAdapter will return NULL if the bluetooth adapter is not
- // supported in the current platform.
- scoped_refptr<device::BluetoothAdapter> GetAdapter();
+ // |callback| will not be run if the bluetooth is not supported in the current
bryeung 2013/01/08 22:24:27 This seems like a frustrating API. Can we have th
youngki 2013/01/09 15:12:03 Done.
+ // platform.
+ void RunCallbackOnAdapterReady(
+ const device::BluetoothAdapterFactory::AdapterCallback& callback);
// Called when a bluetooth event listener is added.
void OnListenerAdded();
@@ -74,6 +76,7 @@ class ExtensionBluetoothEventRouter
}
private:
void InitializeAdapterIfNeeded();
+ bool InitializeAdapter(scoped_refptr<device::BluetoothAdapter> adapter);
void MaybeReleaseAdapter();
void DispatchAdapterStateEvent();

Powered by Google App Engine
This is Rietveld 408576698