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

Unified Diff: chromeos/dbus/fake_bluetooth_media_endpoint_service_provider.cc

Issue 910023002: device/bluetooth:Implement BluetoothMediaEndpointServiceProvider delegate and media-related overrid… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved the addition/removal of all types of observer to constructor/destructor. Created 5 years, 10 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_endpoint_service_provider.cc
diff --git a/chromeos/dbus/fake_bluetooth_media_endpoint_service_provider.cc b/chromeos/dbus/fake_bluetooth_media_endpoint_service_provider.cc
index 2929cc92a356043deca35cbae5aa21c2714c2260..31f8361b72811fcdd6da2d2479acdbff1065f669 100644
--- a/chromeos/dbus/fake_bluetooth_media_endpoint_service_provider.cc
+++ b/chromeos/dbus/fake_bluetooth_media_endpoint_service_provider.cc
@@ -4,30 +4,38 @@
#include "chromeos/dbus/fake_bluetooth_media_endpoint_service_provider.h"
+#include "chromeos/dbus/dbus_thread_manager.h"
+#include "chromeos/dbus/fake_bluetooth_media_client.h"
+#include "chromeos/dbus/fake_bluetooth_media_transport_client.h"
+
+using dbus::ObjectPath;
+
namespace chromeos {
-// TODO(mcchou): Add the logic of the behavior.
FakeBluetoothMediaEndpointServiceProvider::
- FakeBluetoothMediaEndpointServiceProvider(
- const dbus::ObjectPath object_path, Delegate* delegate)
- : object_path_(object_path) , delegate_(delegate) {
+ FakeBluetoothMediaEndpointServiceProvider(const ObjectPath& object_path,
+ Delegate* delegate)
+ : visible_(false), object_path_(object_path), delegate_(delegate) {
VLOG(1) << "Create Bluetooth Media Endpoint: " << object_path_.value();
- // TODO(mcchou): Use the FakeBluetoothMediaClient in DBusThreadManager
- // to register the FakeBluetoothMediaEndpoint object.
}
FakeBluetoothMediaEndpointServiceProvider::
~FakeBluetoothMediaEndpointServiceProvider() {
VLOG(1) << "Cleaning up Bluetooth Media Endpoint: " << object_path_.value();
- // TODO(mcchou): Use the FakeBluetoothMediaClient in DBusThreadManager
- // to unregister the FakeBluetoothMediaEndpoint object.
}
void FakeBluetoothMediaEndpointServiceProvider::SetConfiguration(
- const dbus::ObjectPath& transport_path,
- const dbus::MessageReader& properties) {
+ const ObjectPath& transport_path,
+ const Delegate::TransportProperties& properties) {
VLOG(1) << object_path_.value() << ": SetConfiguration for "
<< transport_path.value();
+
+ // Makes the transport object valid for the given endpoint path.
+ FakeBluetoothMediaTransportClient* transport =
+ static_cast<FakeBluetoothMediaTransportClient*>(
+ DBusThreadManager::Get()->GetBluetoothMediaTransportClient());
+ transport->SetValid(object_path_, true);
+
delegate_->SetConfiguration(transport_path, properties);
}
@@ -39,15 +47,15 @@ void FakeBluetoothMediaEndpointServiceProvider::SelectConfiguration(
}
void FakeBluetoothMediaEndpointServiceProvider::ClearConfiguration(
- const dbus::ObjectPath& transport_path) {
- VLOG(1) << object_path_.value() << ": ClearConfiguration for"
+ const ObjectPath& transport_path) {
+ VLOG(1) << object_path_.value() << ": ClearConfiguration on "
<< transport_path.value();
delegate_->ClearConfiguration(transport_path);
}
-void FakeBluetoothMediaEndpointServiceProvider::Release() {
- VLOG(1) << object_path_.value() << ": Release";
- delegate_->Release();
+void FakeBluetoothMediaEndpointServiceProvider::Released() {
+ VLOG(1) << object_path_.value() << ": Released";
+ delegate_->Released();
}
} // namespace chromeos
« no previous file with comments | « chromeos/dbus/fake_bluetooth_media_endpoint_service_provider.h ('k') | chromeos/dbus/fake_bluetooth_media_transport_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698