From d358f57009b85fb7440208afa5ba87636b491889 Mon Sep 17 00:00:00 2001 From: "keybuk@chromium.org" Date: Thu, 20 Feb 2014 13:27:00 +0000 Subject: Refactor to support default Bluetooth pairing delegate In order to support a default pairing delegate we need to move the agent service provider delegate implementation from BluetoothDevice to BluetoothAdapter while retaining the existing API. BUG=338492 TEST=device_unittests, unit_tests, browser_tests Review URL: https://codereview.chromium.org/148293003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252216 0039d316-1c4b-4281-b951-d872f2087c98 --- chromeos/dbus/fake_bluetooth_agent_manager_client.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'chromeos/dbus/fake_bluetooth_agent_manager_client.cc') diff --git a/chromeos/dbus/fake_bluetooth_agent_manager_client.cc b/chromeos/dbus/fake_bluetooth_agent_manager_client.cc index 2672ad5..b2bdf96 100644 --- a/chromeos/dbus/fake_bluetooth_agent_manager_client.cc +++ b/chromeos/dbus/fake_bluetooth_agent_manager_client.cc @@ -45,8 +45,11 @@ void FakeBluetoothAgentManagerClient::UnregisterAgent( const base::Closure& callback, const ErrorCallback& error_callback) { VLOG(1) << "UnregisterAgent: " << agent_path.value(); - if (service_provider_ != NULL) { - error_callback.Run(bluetooth_agent_manager::kErrorInvalidArguments, + if (service_provider_ == NULL) { + error_callback.Run(bluetooth_agent_manager::kErrorDoesNotExist, + "No agent registered"); + } else if (service_provider_->object_path_ != agent_path) { + error_callback.Run(bluetooth_agent_manager::kErrorDoesNotExist, "Agent still registered"); } else { callback.Run(); -- cgit v1.1