OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_profile_service_provider.h" | 5 #include "device/bluetooth/dbus/fake_bluetooth_profile_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_profile_manager_client.h" | 8 #include "device/bluetooth/dbus/fake_bluetooth_profile_manager_client.h" |
9 | 9 |
10 namespace chromeos { | 10 namespace bluez { |
11 | 11 |
12 FakeBluetoothProfileServiceProvider::FakeBluetoothProfileServiceProvider( | 12 FakeBluetoothProfileServiceProvider::FakeBluetoothProfileServiceProvider( |
13 const dbus::ObjectPath& object_path, | 13 const dbus::ObjectPath& object_path, |
14 Delegate* delegate) | 14 Delegate* delegate) |
15 : object_path_(object_path), | 15 : object_path_(object_path), delegate_(delegate) { |
16 delegate_(delegate) { | |
17 VLOG(1) << "Creating Bluetooth Profile: " << object_path_.value(); | 16 VLOG(1) << "Creating Bluetooth Profile: " << object_path_.value(); |
18 | 17 |
19 FakeBluetoothProfileManagerClient* fake_bluetooth_profile_manager_client = | 18 FakeBluetoothProfileManagerClient* fake_bluetooth_profile_manager_client = |
20 static_cast<FakeBluetoothProfileManagerClient*>( | 19 static_cast<FakeBluetoothProfileManagerClient*>( |
21 DBusThreadManager::Get()->GetBluetoothProfileManagerClient()); | 20 bluez::BluezDBusManager::Get()->GetBluetoothProfileManagerClient()); |
22 fake_bluetooth_profile_manager_client->RegisterProfileServiceProvider(this); | 21 fake_bluetooth_profile_manager_client->RegisterProfileServiceProvider(this); |
23 } | 22 } |
24 | 23 |
25 FakeBluetoothProfileServiceProvider::~FakeBluetoothProfileServiceProvider() { | 24 FakeBluetoothProfileServiceProvider::~FakeBluetoothProfileServiceProvider() { |
26 VLOG(1) << "Cleaning up Bluetooth Profile: " << object_path_.value(); | 25 VLOG(1) << "Cleaning up Bluetooth Profile: " << object_path_.value(); |
27 | 26 |
28 FakeBluetoothProfileManagerClient* fake_bluetooth_profile_manager_client = | 27 FakeBluetoothProfileManagerClient* fake_bluetooth_profile_manager_client = |
29 static_cast<FakeBluetoothProfileManagerClient*>( | 28 static_cast<FakeBluetoothProfileManagerClient*>( |
30 DBusThreadManager::Get()->GetBluetoothProfileManagerClient()); | 29 bluez::BluezDBusManager::Get()->GetBluetoothProfileManagerClient()); |
31 fake_bluetooth_profile_manager_client->UnregisterProfileServiceProvider(this); | 30 fake_bluetooth_profile_manager_client->UnregisterProfileServiceProvider(this); |
32 } | 31 } |
33 | 32 |
34 void FakeBluetoothProfileServiceProvider::Released() { | 33 void FakeBluetoothProfileServiceProvider::Released() { |
35 VLOG(1) << object_path_.value() << ": Released"; | 34 VLOG(1) << object_path_.value() << ": Released"; |
36 delegate_->Released(); | 35 delegate_->Released(); |
37 } | 36 } |
38 | 37 |
39 void FakeBluetoothProfileServiceProvider::NewConnection( | 38 void FakeBluetoothProfileServiceProvider::NewConnection( |
40 const dbus::ObjectPath& device_path, | 39 const dbus::ObjectPath& device_path, |
(...skipping 11 matching lines...) Expand all Loading... |
52 VLOG(1) << object_path_.value() << ": RequestDisconnection for " | 51 VLOG(1) << object_path_.value() << ": RequestDisconnection for " |
53 << device_path.value(); | 52 << device_path.value(); |
54 delegate_->RequestDisconnection(device_path, callback); | 53 delegate_->RequestDisconnection(device_path, callback); |
55 } | 54 } |
56 | 55 |
57 void FakeBluetoothProfileServiceProvider::Cancel() { | 56 void FakeBluetoothProfileServiceProvider::Cancel() { |
58 VLOG(1) << object_path_.value() << ": Cancel"; | 57 VLOG(1) << object_path_.value() << ": Cancel"; |
59 delegate_->Cancel(); | 58 delegate_->Cancel(); |
60 } | 59 } |
61 | 60 |
62 } // namespace chromeos | 61 } // namespace bluez |
OLD | NEW |