OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chromeos/dbus/fake_bluetooth_media_endpoint_service_provider.h" | |
6 | |
7 #include "chromeos/dbus/dbus_thread_manager.h" | |
8 #include "chromeos/dbus/fake_bluetooth_media_client.h" | |
9 #include "chromeos/dbus/fake_bluetooth_media_transport_client.h" | |
10 | |
11 using dbus::ObjectPath; | |
12 | |
13 namespace chromeos { | |
14 | |
15 FakeBluetoothMediaEndpointServiceProvider:: | |
16 FakeBluetoothMediaEndpointServiceProvider(const ObjectPath& object_path, | |
17 Delegate* delegate) | |
18 : visible_(false), object_path_(object_path), delegate_(delegate) { | |
19 VLOG(1) << "Create Bluetooth Media Endpoint: " << object_path_.value(); | |
20 } | |
21 | |
22 FakeBluetoothMediaEndpointServiceProvider:: | |
23 ~FakeBluetoothMediaEndpointServiceProvider() { | |
24 VLOG(1) << "Cleaning up Bluetooth Media Endpoint: " << object_path_.value(); | |
25 } | |
26 | |
27 void FakeBluetoothMediaEndpointServiceProvider::SetConfiguration( | |
28 const ObjectPath& transport_path, | |
29 const Delegate::TransportProperties& properties) { | |
30 VLOG(1) << object_path_.value() << ": SetConfiguration for " | |
31 << transport_path.value(); | |
32 | |
33 delegate_->SetConfiguration(transport_path, properties); | |
34 } | |
35 | |
36 void FakeBluetoothMediaEndpointServiceProvider::SelectConfiguration( | |
37 const std::vector<uint8_t>& capabilities, | |
38 const Delegate::SelectConfigurationCallback& callback) { | |
39 VLOG(1) << object_path_.value() << ": SelectConfiguration"; | |
40 | |
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); | |
49 } | |
50 | |
51 void FakeBluetoothMediaEndpointServiceProvider::ClearConfiguration( | |
52 const ObjectPath& transport_path) { | |
53 VLOG(1) << object_path_.value() << ": ClearConfiguration on " | |
54 << transport_path.value(); | |
55 | |
56 delegate_->ClearConfiguration(transport_path); | |
57 } | |
58 | |
59 void FakeBluetoothMediaEndpointServiceProvider::Released() { | |
60 VLOG(1) << object_path_.value() << ": Released"; | |
61 | |
62 delegate_->Released(); | |
63 } | |
64 | |
65 } // namespace chromeos | |
OLD | NEW |