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

Unified Diff: device/bluetooth/bluetooth_device_experimental_chromeos.cc

Issue 14487002: Bluetooth: Profile support for Chrome OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add unit tests, and class comments Created 7 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
« no previous file with comments | « device/bluetooth/bluetooth_device_experimental_chromeos.h ('k') | device/bluetooth/bluetooth_profile.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_device_experimental_chromeos.cc
diff --git a/device/bluetooth/bluetooth_device_experimental_chromeos.cc b/device/bluetooth/bluetooth_device_experimental_chromeos.cc
index fb45ad0b751aef0ff47c5b4fc502551a188d0a5d..80fd802573f543a8e5e94dcb042f7368f2296ded 100644
--- a/device/bluetooth/bluetooth_device_experimental_chromeos.cc
+++ b/device/bluetooth/bluetooth_device_experimental_chromeos.cc
@@ -16,6 +16,7 @@
#include "chromeos/dbus/experimental_bluetooth_input_client.h"
#include "dbus/bus.h"
#include "device/bluetooth/bluetooth_adapter_experimental_chromeos.h"
+#include "device/bluetooth/bluetooth_profile_experimental_chromeos.h"
#include "device/bluetooth/bluetooth_socket.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
@@ -392,8 +393,24 @@ void BluetoothDeviceExperimentalChromeOS::ConnectToProfile(
device::BluetoothProfile* profile,
const base::Closure& callback,
const ErrorCallback& error_callback) {
- // TODO(keybuk): implement
- error_callback.Run();
+ BluetoothProfileExperimentalChromeOS* profile_chromeos =
+ static_cast<BluetoothProfileExperimentalChromeOS*>(profile);
+ VLOG(1) << object_path_.value() << ": Connecting profile: "
+ << profile_chromeos->uuid();
+ DBusThreadManager::Get()->GetExperimentalBluetoothDeviceClient()->
+ ConnectProfile(
+ object_path_,
+ profile_chromeos->uuid(),
+ base::Bind(
+ &BluetoothDeviceExperimentalChromeOS::OnConnectProfile,
+ weak_ptr_factory_.GetWeakPtr(),
+ profile,
+ callback),
+ base::Bind(
+ &BluetoothDeviceExperimentalChromeOS::OnConnectProfileError,
+ weak_ptr_factory_.GetWeakPtr(),
+ profile,
+ error_callback));
}
void BluetoothDeviceExperimentalChromeOS::SetOutOfBandPairingData(
@@ -804,4 +821,27 @@ bool BluetoothDeviceExperimentalChromeOS::RunPairingCallbacks(Status status) {
return callback_run;
}
+void BluetoothDeviceExperimentalChromeOS::OnConnectProfile(
+ device::BluetoothProfile* profile,
+ const base::Closure& callback) {
+ BluetoothProfileExperimentalChromeOS* profile_chromeos =
+ static_cast<BluetoothProfileExperimentalChromeOS*>(profile);
+ VLOG(1) << object_path_.value() << ": Profile connected: "
+ << profile_chromeos->uuid();
+ callback.Run();
+}
+
+void BluetoothDeviceExperimentalChromeOS::OnConnectProfileError(
+ device::BluetoothProfile* profile,
+ const ErrorCallback& error_callback,
+ const std::string& error_name,
+ const std::string& error_message) {
+ BluetoothProfileExperimentalChromeOS* profile_chromeos =
+ static_cast<BluetoothProfileExperimentalChromeOS*>(profile);
+ VLOG(1) << object_path_.value() << ": Profile connection failed: "
+ << profile_chromeos->uuid() << ": "
+ << error_name << ": " << error_message;
+ error_callback.Run();
+}
+
} // namespace chromeos
« no previous file with comments | « device/bluetooth/bluetooth_device_experimental_chromeos.h ('k') | device/bluetooth/bluetooth_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698