Upstream version 10.38.222.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / api / easy_unlock_private / easy_unlock_private_bluetooth_util.h
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE_BLUETOOTH_UTIL_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE_BLUETOOTH_UTIL_H_
7
8 #include <string>
9
10 #include "base/callback_forward.h"
11 #include "device/bluetooth/bluetooth_device.h"
12
13 namespace device {
14 class BluetoothUUID;
15 }
16
17 namespace extensions {
18 namespace api {
19 namespace easy_unlock {
20
21 struct SeekDeviceResult {
22   // Whether the connection to the device succeeded.
23   bool success;
24
25   // If the connection failed, an error message describing the failure.
26   std::string error_message;
27 };
28 typedef base::Callback<void(const SeekDeviceResult& result)> SeekDeviceCallback;
29
30 // Connects to the SDP service on the Bluetooth device with the given
31 // |device_address|, if possible. Calls the |callback| with an indicator of
32 // success or an error message on failure.
33 void SeekBluetoothDeviceByAddress(const std::string& device_address,
34                                   const SeekDeviceCallback& callback);
35
36 void ConnectToBluetoothServiceInsecurely(
37     device::BluetoothDevice* device,
38     const device::BluetoothUUID& uuid,
39     const device::BluetoothDevice::ConnectToServiceCallback& callback,
40     const device::BluetoothDevice::ConnectToServiceErrorCallback&
41         error_callback);
42
43 }  // namespace easy_unlock
44 }  // namespace api
45 }  // namespace extensions
46
47 #endif  // CHROME_BROWSER_EXTENSIONS_API_EASY_UNLOCK_PRIVATE_EASY_UNLOCK_PRIVATE_BLUETOOTH_UTIL_H_