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

Side by Side Diff: device/bluetooth/dbus/fake_bluetooth_media_endpoint_service_provider.cc

Issue 1347193004: Refactor DBusThreadManager to split away BT clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
OLDNEW
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 "device/bluetooth/dbus/fake_bluetooth_media_endpoint_service_provider.h "
6 6
7 #include "chromeos/dbus/dbus_thread_manager.h" 7 #include "device/bluetooth/dbus/bluez_dbus_manager.h"
8 #include "chromeos/dbus/fake_bluetooth_media_client.h" 8 #include "device/bluetooth/dbus/fake_bluetooth_media_client.h"
9 #include "chromeos/dbus/fake_bluetooth_media_transport_client.h" 9 #include "device/bluetooth/dbus/fake_bluetooth_media_transport_client.h"
10 10
11 using dbus::ObjectPath; 11 using dbus::ObjectPath;
12 12
13 namespace chromeos { 13 namespace bluez {
14 14
15 FakeBluetoothMediaEndpointServiceProvider:: 15 FakeBluetoothMediaEndpointServiceProvider::
16 FakeBluetoothMediaEndpointServiceProvider(const ObjectPath& object_path, 16 FakeBluetoothMediaEndpointServiceProvider(const ObjectPath& object_path,
17 Delegate* delegate) 17 Delegate* delegate)
18 : visible_(false), object_path_(object_path), delegate_(delegate) { 18 : visible_(false), object_path_(object_path), delegate_(delegate) {
19 VLOG(1) << "Create Bluetooth Media Endpoint: " << object_path_.value(); 19 VLOG(1) << "Create Bluetooth Media Endpoint: " << object_path_.value();
20 } 20 }
21 21
22 FakeBluetoothMediaEndpointServiceProvider:: 22 FakeBluetoothMediaEndpointServiceProvider::
23 ~FakeBluetoothMediaEndpointServiceProvider() { 23 ~FakeBluetoothMediaEndpointServiceProvider() {
(...skipping 12 matching lines...) Expand all
36 void FakeBluetoothMediaEndpointServiceProvider::SelectConfiguration( 36 void FakeBluetoothMediaEndpointServiceProvider::SelectConfiguration(
37 const std::vector<uint8_t>& capabilities, 37 const std::vector<uint8_t>& capabilities,
38 const Delegate::SelectConfigurationCallback& callback) { 38 const Delegate::SelectConfigurationCallback& callback) {
39 VLOG(1) << object_path_.value() << ": SelectConfiguration"; 39 VLOG(1) << object_path_.value() << ": SelectConfiguration";
40 40
41 delegate_->SelectConfiguration(capabilities, callback); 41 delegate_->SelectConfiguration(capabilities, callback);
42 42
43 // Makes the transport object valid for the given endpoint path. 43 // Makes the transport object valid for the given endpoint path.
44 FakeBluetoothMediaTransportClient* transport = 44 FakeBluetoothMediaTransportClient* transport =
45 static_cast<FakeBluetoothMediaTransportClient*>( 45 static_cast<FakeBluetoothMediaTransportClient*>(
46 DBusThreadManager::Get()->GetBluetoothMediaTransportClient()); 46 bluez::BluezDBusManager::Get()->GetBluetoothMediaTransportClient());
47 DCHECK(transport); 47 DCHECK(transport);
48 transport->SetValid(this, true); 48 transport->SetValid(this, true);
49 } 49 }
50 50
51 void FakeBluetoothMediaEndpointServiceProvider::ClearConfiguration( 51 void FakeBluetoothMediaEndpointServiceProvider::ClearConfiguration(
52 const ObjectPath& transport_path) { 52 const ObjectPath& transport_path) {
53 VLOG(1) << object_path_.value() << ": ClearConfiguration on " 53 VLOG(1) << object_path_.value() << ": ClearConfiguration on "
54 << transport_path.value(); 54 << transport_path.value();
55 55
56 delegate_->ClearConfiguration(transport_path); 56 delegate_->ClearConfiguration(transport_path);
57 } 57 }
58 58
59 void FakeBluetoothMediaEndpointServiceProvider::Released() { 59 void FakeBluetoothMediaEndpointServiceProvider::Released() {
60 VLOG(1) << object_path_.value() << ": Released"; 60 VLOG(1) << object_path_.value() << ": Released";
61 61
62 delegate_->Released(); 62 delegate_->Released();
63 } 63 }
64 64
65 } // namespace chromeos 65 } // namespace bluez
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698