Chromium Code Reviews| Index: chromeos/dbus/fake_bluetooth_media_transport_client.h |
| diff --git a/chromeos/dbus/fake_bluetooth_media_transport_client.h b/chromeos/dbus/fake_bluetooth_media_transport_client.h |
| index f88908f6111db8919c39632a6bac9022d075118a..7bc1f9b04254a4ca895a735a674b2bc206b39b54 100644 |
| --- a/chromeos/dbus/fake_bluetooth_media_transport_client.h |
| +++ b/chromeos/dbus/fake_bluetooth_media_transport_client.h |
| @@ -17,6 +17,8 @@ |
| namespace chromeos { |
| +class FakeBluetoothMediaEndpointServiceProvider; |
| + |
| class CHROMEOS_EXPORT FakeBluetoothMediaTransportClient |
| : public BluetoothMediaTransportClient { |
| public: |
| @@ -31,6 +33,16 @@ class CHROMEOS_EXPORT FakeBluetoothMediaTransportClient |
| dbus::PropertySet::SetCallback callback) override; |
| }; |
| + class Transport { |
|
armansito
2015/02/26 04:23:08
Make this class private. As in, move it below the
Miao
2015/02/26 04:41:50
Done.
|
| + public: |
| + Transport(const dbus::ObjectPath& transport_path, |
| + Properties* transport_properties); |
| + ~Transport(); |
| + |
| + dbus::ObjectPath path; |
| + scoped_ptr<Properties> properties; |
| + }; |
| + |
| // The default path of the transport object. |
| static const char kTransportPath[]; |
| @@ -62,23 +74,40 @@ class CHROMEOS_EXPORT FakeBluetoothMediaTransportClient |
| const base::Closure& callback, |
| const ErrorCallback& error_callback) override; |
| - // Makes the transport valid/invalid for a given media endpoint path. The |
| - // transport object is assigned to the given endpoint if valid is true, false |
| + // Makes the transport valid/invalid for a given media endpoint. The transport |
| + // object is assigned to the given endpoint if valid is true, false |
| // otherwise. |
| - void SetValid(const dbus::ObjectPath& endpoint_path, bool valid); |
| + void SetValid(FakeBluetoothMediaEndpointServiceProvider* endpoint, |
| + bool valid); |
| + |
| + // Set state/volume property to a certain value. |
| + void SetState(const dbus::ObjectPath& endpoint_path, |
| + const std::string& state); |
| + void SetVolume(const dbus::ObjectPath& endpoint_path, |
| + const uint16_t& volume); |
| + |
| + // Gets the transport path associated with the given endpoint path. |
| + dbus::ObjectPath GetTransportPath(const dbus::ObjectPath& endpoint_path); |
| + |
| + // Gets the endpoint path associated with the given transport_path. |
| + dbus::ObjectPath GetEndpointPath(const dbus::ObjectPath& transport_path); |
| private: |
| // Property callback passed while a Properties structure is created. |
| void OnPropertyChanged(const std::string& property_name); |
| - // The path of the media transport object. |
| - dbus::ObjectPath object_path_; |
| + // Map of endpoints with valid transport. Each pair is composed of an endpoint |
| + // path and a Transport structure containing a transport path and its |
| + // properties. |
| + std::map<dbus::ObjectPath, Transport*> endpoint_to_transport_map_; |
| - // Indicates whether endpoints are assigned with the transport object. |
| - std::map<dbus::ObjectPath, bool> endpoints_; |
| + // Map of valid transports. Each pair is composed of a transport path as the |
| + // key and an endpoint path as the value. This map is used to get the |
| + // corresponding endpoint path when GetProperties() is called. |
| + std::map<dbus::ObjectPath, dbus::ObjectPath> transport_to_endpoint_map_; |
| - // The fake property set of the media transport object. |
| - scoped_ptr<Properties> properties_; |
| + // The path of the media transport object. |
| + dbus::ObjectPath object_path_; |
| ObserverList<BluetoothMediaTransportClient::Observer> observers_; |