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

Unified Diff: chromeos/dbus/fake_bluetooth_media_client.cc

Issue 876153002: device/bluetooth:Implement Register() for BluetoothAudioSinkChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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: chromeos/dbus/fake_bluetooth_media_client.cc
diff --git a/chromeos/dbus/fake_bluetooth_media_client.cc b/chromeos/dbus/fake_bluetooth_media_client.cc
index 3e57b91f439b858851fe17f5532d4b8d8440f12e..22a1126c3b015d44442793969aff1861a4951989 100644
--- a/chromeos/dbus/fake_bluetooth_media_client.cc
+++ b/chromeos/dbus/fake_bluetooth_media_client.cc
@@ -4,6 +4,12 @@
#include "chromeos/dbus/fake_bluetooth_media_client.h"
+namespace {
+
+ const char kNotImplementedError[] = "org.chromium.Error.NotImplemented";
armansito 2015/01/27 04:38:05 nit: don't indent variables within namespace.
Miao 2015/01/28 02:05:01 Done.
+ const char kInvalidArgumentError[] = "org.chromium.Error.InvalidArgument";
armansito 2015/01/27 04:38:05 nit: newline.
Miao 2015/01/28 02:05:01 Done.
+} // namespace
+
namespace chromeos {
FakeBluetoothMediaClient::FakeBluetoothMediaClient() {
@@ -27,15 +33,19 @@ void FakeBluetoothMediaClient::RemoveObserver(
observers_.RemoveObserver(observer);
}
-// TODO(mcchou): Add method definition for |RegisterEndpoint|,
-// |UnregisterEndpoint|, |RegisterPlayer| and |UnregisterPlayer|.
void FakeBluetoothMediaClient::RegisterEndpoint(
const dbus::ObjectPath& object_path,
const dbus::ObjectPath& endpoint_path,
const EndpointProperties& properties,
const base::Closure& callback,
const ErrorCallback& error_callback) {
- error_callback.Run("org.bluez.NotImplemented", "");
+ VLOG(1) << "RegisterEndpoint: " << endpoint_path.value();
+ media_path_ = object_path;
armansito 2015/01/27 04:38:05 I'm not exactly sure what you're using |media_path
Miao 2015/01/28 02:05:01 Done.
+ if (properties.capabilities.empty()) {
armansito 2015/01/27 04:38:05 What about the |codec| and |uuid| fields?
Miao 2015/01/28 02:05:01 Done.
+ error_callback.Run(kInvalidArgumentError, "");
+ return;
+ }
+ callback.Run();
}
void FakeBluetoothMediaClient::UnregisterEndpoint(
@@ -43,7 +53,7 @@ void FakeBluetoothMediaClient::UnregisterEndpoint(
const dbus::ObjectPath& endpoint_path,
const base::Closure& callback,
const ErrorCallback& error_callback) {
- error_callback.Run("org.bluez.NotImplemented", "");
+ error_callback.Run(kNotImplementedError, "");
}
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698