diff options
author | keybuk@google.com <keybuk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-04 18:39:44 +0000 |
---|---|---|
committer | keybuk@google.com <keybuk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-04 18:39:44 +0000 |
commit | 95e9859ccccc4a131d1d68767fa6cd6d9a18658a (patch) | |
tree | 3a75d9acf6a9122d2a40a5383c9d73dbfc26da81 /chrome/browser/chromeos/bluetooth/bluetooth_device.h | |
parent | 9c02fa0e4d7a8126f4901c8d28b0d2468a3e2fa5 (diff) | |
download | chromium_src-95e9859ccccc4a131d1d68767fa6cd6d9a18658a.zip chromium_src-95e9859ccccc4a131d1d68767fa6cd6d9a18658a.tar.gz chromium_src-95e9859ccccc4a131d1d68767fa6cd6d9a18658a.tar.bz2 |
bluetooth: obtain D-Bus error for select methods
For the CreateDevice, CreatePairedDevice and Connect methods use
CallMethodWithErrorCallback rather than CallMethod so that we obtain
richer error information from the BlueZ service.
BUG=chromium-os:27902
TEST=make chrome
Change-Id: If801d834604e4c2142c20169603bc527bde09403
Review URL: https://chromiumcodereview.appspot.com/10409062
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140334 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/bluetooth/bluetooth_device.h')
-rw-r--r-- | chrome/browser/chromeos/bluetooth/bluetooth_device.h | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_device.h b/chrome/browser/chromeos/bluetooth/bluetooth_device.h index 8892bce..cd46b7f 100644 --- a/chrome/browser/chromeos/bluetooth/bluetooth_device.h +++ b/chrome/browser/chromeos/bluetooth/bluetooth_device.h @@ -284,12 +284,19 @@ class BluetoothDevice : private BluetoothDeviceClient::Observer, bool update_state); // Called by BluetoothAdapterClient when a call to CreateDevice() or - // CreatePairedDevice() to provide the new object path for the remote - // device in |device_path| and |success| which indicates whether or not - // the request succeeded. |error_callback| is the callback provided to + // CreatePairedDevice() succeeds, provides the new object path for the remote + // device in |device_path|. |error_callback| is the callback provided to // Connect(). void ConnectCallback(ErrorCallback error_callback, - const dbus::ObjectPath& device_path, bool success); + const dbus::ObjectPath& device_path); + + // Called by BluetoothAdapterClient when a call to CreateDevice() or + // CreatePairedDevice() fails with the error named |error_name| and + // optional message |error_message|, |error_callback| is the callback + // provided to Connect(). + void ConnectErrorCallback(ErrorCallback error_callback, + const std::string& error_name, + const std::string& error_message); // Called by BluetoothProperty when the call to Set() for the Trusted // property completes. |success| indicates whether or not the request @@ -311,14 +318,23 @@ class BluetoothDevice : private BluetoothDeviceClient::Observer, const dbus::ObjectPath& device_path, const std::string& xml_data, bool success); - // Called by BluetoothInputClient when the call to Connect() completes. - // |success| indicates whether or not the request succeed, |error_callback| - // is the callback provided to ConnectApplications(), |interface_name| - // specifies the interface being connect and |device_path| the remote - // object path. - void OnConnect(ErrorCallback error_callback, - const std::string& interface_name, - const dbus::ObjectPath& device_path, bool success); + // Called by BluetoothInputClient when the call to Connect() succeeds. + // |error_callback| is the callback provided to ConnectApplications(), + // |interface_name| specifies the interface being connected and + // |device_path| the remote object path. + void OnConnect(const std::string& interface_name, + const dbus::ObjectPath& device_path); + + // Called by BluetoothInputClient when the call to Connect() fails. + // |error_callback| is the callback provided to ConnectApplications(), + // |interface_name| specifies the interface being connected, + // |device_path| the remote object path, + // |error_name| the error name and |error_message| the optional message. + void OnConnectError(ErrorCallback error_callback, + const std::string& interface_name, + const dbus::ObjectPath& device_path, + const std::string& error_name, + const std::string& error_message); // Called by BluetoothDeviceClient when a call to Disconnect() completes, // |success| indicates whether or not the request succeeded, |error_callback| |