OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chromeos/dbus/fake_bluetooth_agent_service_provider.h" |
| 6 |
| 7 #include "dbus/object_path.h" |
| 8 |
| 9 namespace chromeos { |
| 10 |
| 11 FakeBluetoothAgentServiceProvider::FakeBluetoothAgentServiceProvider( |
| 12 const dbus::ObjectPath& object_path, |
| 13 Delegate* delegate) |
| 14 : object_path_(object_path), |
| 15 delegate_(delegate) { |
| 16 VLOG(1) << "Creating Bluetooth Agent: " << object_path_.value(); |
| 17 } |
| 18 |
| 19 FakeBluetoothAgentServiceProvider::~FakeBluetoothAgentServiceProvider() { |
| 20 VLOG(1) << "Cleaning up Bluetooth Agent: " << object_path_.value(); |
| 21 |
| 22 delegate_ = NULL; |
| 23 } |
| 24 |
| 25 void FakeBluetoothAgentServiceProvider::Release() { |
| 26 VLOG(1) << object_path_.value() << ": Release"; |
| 27 delegate_->Release(); |
| 28 } |
| 29 |
| 30 void FakeBluetoothAgentServiceProvider::RequestPinCode( |
| 31 const dbus::ObjectPath& device_path, |
| 32 const Delegate::PinCodeCallback& callback) { |
| 33 VLOG(1) << object_path_.value() << ": RequestPinCode for " |
| 34 << device_path.value(); |
| 35 delegate_->RequestPinCode(device_path, callback); |
| 36 } |
| 37 |
| 38 void FakeBluetoothAgentServiceProvider::DisplayPinCode( |
| 39 const dbus::ObjectPath& device_path, |
| 40 const std::string& pincode) { |
| 41 VLOG(1) << object_path_.value() << ": DisplayPincode " << pincode << " for " |
| 42 << device_path.value(); |
| 43 delegate_->DisplayPinCode(device_path, pincode); |
| 44 } |
| 45 |
| 46 void FakeBluetoothAgentServiceProvider::RequestPasskey( |
| 47 const dbus::ObjectPath& device_path, |
| 48 const Delegate::PasskeyCallback& callback) { |
| 49 VLOG(1) << object_path_.value() << ": RequestPasskey for " |
| 50 << device_path.value(); |
| 51 delegate_->RequestPasskey(device_path, callback); |
| 52 } |
| 53 |
| 54 void FakeBluetoothAgentServiceProvider::DisplayPasskey( |
| 55 const dbus::ObjectPath& device_path, |
| 56 uint32 passkey, int16 entered) { |
| 57 VLOG(1) << object_path_.value() << ": DisplayPasskey " << passkey |
| 58 << " (" << entered << " entered) for "<< device_path.value(); |
| 59 delegate_->DisplayPasskey(device_path, passkey, entered); |
| 60 } |
| 61 |
| 62 void FakeBluetoothAgentServiceProvider::RequestConfirmation( |
| 63 const dbus::ObjectPath& device_path, |
| 64 uint32 passkey, |
| 65 const Delegate::ConfirmationCallback& callback) { |
| 66 VLOG(1) << object_path_.value() << ": RequestConfirmation " << passkey |
| 67 << " for "<< device_path.value(); |
| 68 delegate_->RequestConfirmation(device_path, passkey, callback); |
| 69 } |
| 70 |
| 71 void FakeBluetoothAgentServiceProvider::RequestAuthorization( |
| 72 const dbus::ObjectPath& device_path, |
| 73 const Delegate::ConfirmationCallback& callback) { |
| 74 VLOG(1) << object_path_.value() << ": RequestAuthorization for " |
| 75 << device_path.value(); |
| 76 delegate_->RequestAuthorization(device_path, callback); |
| 77 } |
| 78 |
| 79 void FakeBluetoothAgentServiceProvider::AuthorizeService( |
| 80 const dbus::ObjectPath& device_path, |
| 81 const std::string& uuid, |
| 82 const Delegate::ConfirmationCallback& callback) { |
| 83 VLOG(1) << object_path_.value() << ": AuthorizeService " << uuid << " for " |
| 84 << device_path.value(); |
| 85 delegate_->AuthorizeService(device_path, uuid, callback); |
| 86 } |
| 87 |
| 88 void FakeBluetoothAgentServiceProvider::Cancel() { |
| 89 VLOG(1) << object_path_.value() << ": Cancel"; |
| 90 delegate_->Cancel(); |
| 91 } |
| 92 |
| 93 } // namespace chromeos |
OLD | NEW |