Chromium Code Reviews| 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..c3ddfdd39b0877504dff82de417a616d52771af3 100644 |
| --- a/chromeos/dbus/fake_bluetooth_media_endpoint_service_provider.cc |
| +++ b/chromeos/dbus/fake_bluetooth_media_endpoint_service_provider.cc |
| @@ -4,30 +4,39 @@ |
| #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(); |
| + |
| + // Sets the visibility to the transport object to true if the media object |
|
Miao
2015/02/10 22:49:11
Update comment in patch 3.
Miao
2015/02/11 23:17:17
Done.
|
| + // is valid. |
| + FakeBluetoothMediaTransportClient* transport = |
| + static_cast<FakeBluetoothMediaTransportClient*>( |
| + DBusThreadManager::Get()->GetBluetoothMediaTransportClient()); |
| + transport->SetValid(object_path_, true); |
| + |
| delegate_->SetConfiguration(transport_path, properties); |
| } |
| @@ -39,15 +48,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 |