Index: chrome/browser/extensions/api/bluetooth/bluetooth_api.cc |
diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc |
index 14bff9d6aad235e415c8207ab7a46f8a67534886..6507753b3affb4b6a6b863ffbb64072577ddd34c 100644 |
--- a/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc |
+++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc |
@@ -6,6 +6,7 @@ |
#include <string> |
+#include "base/bind_helpers.h" |
#include "base/lazy_instance.h" |
#include "base/memory/ref_counted.h" |
#include "chrome/browser/extensions/api/bluetooth/bluetooth_api_utils.h" |
@@ -457,14 +458,20 @@ bool BluetoothConnectFunction::DoWork(scoped_refptr<BluetoothAdapter> adapter) { |
device->ConnectToProfile( |
bluetooth_profile, |
- base::Bind(&BluetoothConnectFunction::OnSuccessCallback, this), |
+ base::Bind(&BluetoothConnectFunction::OnSuccessCallback, this, device), |
keybuk
2014/05/09 22:37:21
You can't pass device pointers around like this, i
|
base::Bind(&BluetoothConnectFunction::OnErrorCallback, this)); |
return true; |
} |
-void BluetoothConnectFunction::OnSuccessCallback() { |
+void BluetoothConnectFunction::OnSuccessCallback(BluetoothDevice* device) { |
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
+ |
+ // TODO(tengs): Remove this once we have an API for starting the connection |
+ // monitor. |
+ DCHECK(device); |
+ device->StartConnectionMonitor(base::Bind(&base::DoNothing), |
+ base::Bind(&base::DoNothing)); |
SendResponse(true); |
} |