| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chromeos/dbus/fake_bluetooth_media_endpoint_service_provider.h" | 5 #include "chromeos/dbus/fake_bluetooth_media_endpoint_service_provider.h" |
| 6 | 6 |
| 7 #include "chromeos/dbus/dbus_thread_manager.h" | 7 #include "chromeos/dbus/dbus_thread_manager.h" |
| 8 #include "chromeos/dbus/fake_bluetooth_media_client.h" | 8 #include "chromeos/dbus/fake_bluetooth_media_client.h" |
| 9 #include "chromeos/dbus/fake_bluetooth_media_transport_client.h" | 9 #include "chromeos/dbus/fake_bluetooth_media_transport_client.h" |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 ~FakeBluetoothMediaEndpointServiceProvider() { | 23 ~FakeBluetoothMediaEndpointServiceProvider() { |
| 24 VLOG(1) << "Cleaning up Bluetooth Media Endpoint: " << object_path_.value(); | 24 VLOG(1) << "Cleaning up Bluetooth Media Endpoint: " << object_path_.value(); |
| 25 } | 25 } |
| 26 | 26 |
| 27 void FakeBluetoothMediaEndpointServiceProvider::SetConfiguration( | 27 void FakeBluetoothMediaEndpointServiceProvider::SetConfiguration( |
| 28 const ObjectPath& transport_path, | 28 const ObjectPath& transport_path, |
| 29 const Delegate::TransportProperties& properties) { | 29 const Delegate::TransportProperties& properties) { |
| 30 VLOG(1) << object_path_.value() << ": SetConfiguration for " | 30 VLOG(1) << object_path_.value() << ": SetConfiguration for " |
| 31 << transport_path.value(); | 31 << transport_path.value(); |
| 32 | 32 |
| 33 // Makes the transport object valid for the given endpoint path. | |
| 34 FakeBluetoothMediaTransportClient* transport = | |
| 35 static_cast<FakeBluetoothMediaTransportClient*>( | |
| 36 DBusThreadManager::Get()->GetBluetoothMediaTransportClient()); | |
| 37 transport->SetValid(object_path_, true); | |
| 38 | |
| 39 delegate_->SetConfiguration(transport_path, properties); | 33 delegate_->SetConfiguration(transport_path, properties); |
| 40 } | 34 } |
| 41 | 35 |
| 42 void FakeBluetoothMediaEndpointServiceProvider::SelectConfiguration( | 36 void FakeBluetoothMediaEndpointServiceProvider::SelectConfiguration( |
| 43 const std::vector<uint8_t>& capabilities, | 37 const std::vector<uint8_t>& capabilities, |
| 44 const Delegate::SelectConfigurationCallback& callback) { | 38 const Delegate::SelectConfigurationCallback& callback) { |
| 45 VLOG(1) << object_path_.value() << ": SelectConfiguration"; | 39 VLOG(1) << object_path_.value() << ": SelectConfiguration"; |
| 40 |
| 46 delegate_->SelectConfiguration(capabilities, callback); | 41 delegate_->SelectConfiguration(capabilities, callback); |
| 42 |
| 43 // Makes the transport object valid for the given endpoint path. |
| 44 FakeBluetoothMediaTransportClient* transport = |
| 45 static_cast<FakeBluetoothMediaTransportClient*>( |
| 46 DBusThreadManager::Get()->GetBluetoothMediaTransportClient()); |
| 47 DCHECK(transport); |
| 48 transport->SetValid(this, true); |
| 47 } | 49 } |
| 48 | 50 |
| 49 void FakeBluetoothMediaEndpointServiceProvider::ClearConfiguration( | 51 void FakeBluetoothMediaEndpointServiceProvider::ClearConfiguration( |
| 50 const ObjectPath& transport_path) { | 52 const ObjectPath& transport_path) { |
| 51 VLOG(1) << object_path_.value() << ": ClearConfiguration on " | 53 VLOG(1) << object_path_.value() << ": ClearConfiguration on " |
| 52 << transport_path.value(); | 54 << transport_path.value(); |
| 55 |
| 53 delegate_->ClearConfiguration(transport_path); | 56 delegate_->ClearConfiguration(transport_path); |
| 54 } | 57 } |
| 55 | 58 |
| 56 void FakeBluetoothMediaEndpointServiceProvider::Released() { | 59 void FakeBluetoothMediaEndpointServiceProvider::Released() { |
| 57 VLOG(1) << object_path_.value() << ": Released"; | 60 VLOG(1) << object_path_.value() << ": Released"; |
| 61 |
| 58 delegate_->Released(); | 62 delegate_->Released(); |
| 59 } | 63 } |
| 60 | 64 |
| 61 } // namespace chromeos | 65 } // namespace chromeos |
| OLD | NEW |