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

Unified Diff: chrome/browser/extensions/api/bluetooth/bluetooth_api.cc

Issue 273953002: Hook up RSSI and host transmit power Bluetooth device properties for ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Start connection monitor when connected through chrome.bluetooth API Created 6 years, 7 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_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);
}

Powered by Google App Engine
This is Rietveld 408576698