summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkeybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-28 03:10:13 +0000
committerkeybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-28 03:10:13 +0000
commitaea943f58df186d0f594e9587431a0bf914a3cfe (patch)
tree3d5379f79d65266f03833706f2f2c694f01d3cf5
parentf4d1902f4bd4e93767850db6392023fc5a579b92 (diff)
downloadchromium_src-aea943f58df186d0f594e9587431a0bf914a3cfe.zip
chromium_src-aea943f58df186d0f594e9587431a0bf914a3cfe.tar.gz
chromium_src-aea943f58df186d0f594e9587431a0bf914a3cfe.tar.bz2
Bluetooth: remove Out of Band Pairing APIs
These is no platform implementation, with no available APIs on at least Chrome OS and OS X to implement these, and Android does not support Out of Band Pairing. Thus remove the APIs, they can always be put back later if we find an implementation. BUG=376492 Review URL: https://codereview.chromium.org/293063015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273136 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/api/bluetooth/bluetooth_api.cc106
-rw-r--r--chrome/browser/extensions/api/bluetooth/bluetooth_api.h33
-rw-r--r--chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc106
-rw-r--r--chrome/common/extensions/api/bluetooth.idl34
-rw-r--r--device/bluetooth/bluetooth.gyp1
-rw-r--r--device/bluetooth/bluetooth_adapter.h12
-rw-r--r--device/bluetooth/bluetooth_adapter_chromeos.cc6
-rw-r--r--device/bluetooth/bluetooth_adapter_chromeos.h4
-rw-r--r--device/bluetooth/bluetooth_adapter_mac.h3
-rw-r--r--device/bluetooth/bluetooth_adapter_mac.mm5
-rw-r--r--device/bluetooth/bluetooth_adapter_unittest.cc5
-rw-r--r--device/bluetooth/bluetooth_adapter_win.cc6
-rw-r--r--device/bluetooth/bluetooth_adapter_win.h3
-rw-r--r--device/bluetooth/bluetooth_device.h15
-rw-r--r--device/bluetooth/bluetooth_device_chromeos.cc15
-rw-r--r--device/bluetooth/bluetooth_device_chromeos.h7
-rw-r--r--device/bluetooth/bluetooth_device_mac.h7
-rw-r--r--device/bluetooth/bluetooth_device_mac.mm14
-rw-r--r--device/bluetooth/bluetooth_device_win.cc14
-rw-r--r--device/bluetooth/bluetooth_device_win.h7
-rw-r--r--device/bluetooth/bluetooth_out_of_band_pairing_data.h27
-rw-r--r--device/bluetooth/test/mock_bluetooth_adapter.h4
-rw-r--r--device/bluetooth/test/mock_bluetooth_device.h8
23 files changed, 0 insertions, 442 deletions
diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc
index 772ebd4..acac2e1 100644
--- a/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc
+++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc
@@ -17,7 +17,6 @@
#include "content/public/browser/browser_thread.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_device.h"
-#include "device/bluetooth/bluetooth_out_of_band_pairing_data.h"
#include "device/bluetooth/bluetooth_profile.h"
#include "device/bluetooth/bluetooth_service_record.h"
#include "device/bluetooth/bluetooth_socket.h"
@@ -43,16 +42,10 @@ namespace Disconnect = extensions::api::bluetooth::Disconnect;
namespace GetDevice = extensions::api::bluetooth::GetDevice;
namespace GetDevices = extensions::api::bluetooth::GetDevices;
namespace RemoveProfile = extensions::api::bluetooth::RemoveProfile;
-namespace SetOutOfBandPairingData =
- extensions::api::bluetooth::SetOutOfBandPairingData;
namespace Send = extensions::api::bluetooth::Send;
namespace {
-const char kCouldNotGetLocalOutOfBandPairingData[] =
- "Could not get local Out Of Band Pairing Data";
-const char kCouldNotSetOutOfBandPairingData[] =
- "Could not set Out Of Band Pairing Data";
const char kInvalidDevice[] = "Invalid device";
const char kInvalidUuid[] = "Invalid UUID";
const char kPermissionDenied[] = "Permission to add profile denied.";
@@ -533,105 +526,6 @@ bool BluetoothGetSocketsFunction::RunAsync() {
return false;
}
-void BluetoothSetOutOfBandPairingDataFunction::OnSuccessCallback() {
- SendResponse(true);
-}
-
-void BluetoothSetOutOfBandPairingDataFunction::OnErrorCallback() {
- SetError(kCouldNotSetOutOfBandPairingData);
- SendResponse(false);
-}
-
-bool BluetoothSetOutOfBandPairingDataFunction::DoWork(
- scoped_refptr<BluetoothAdapter> adapter) {
- // TODO(bryeung): update to new-style parameter passing when ArrayBuffer
- // support is added
- base::DictionaryValue* options;
- EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &options));
- std::string address;
- EXTENSION_FUNCTION_VALIDATE(options->GetString("deviceAddress", &address));
-
- BluetoothDevice* device = adapter->GetDevice(address);
- if (!device) {
- SetError(kInvalidDevice);
- SendResponse(false);
- return false;
- }
-
- if (options->HasKey("data")) {
- base::DictionaryValue* data_in;
- EXTENSION_FUNCTION_VALIDATE(options->GetDictionary("data", &data_in));
-
- device::BluetoothOutOfBandPairingData data_out;
-
- base::BinaryValue* tmp_data;
- EXTENSION_FUNCTION_VALIDATE(data_in->GetBinary("hash", &tmp_data));
- EXTENSION_FUNCTION_VALIDATE(
- tmp_data->GetSize() == device::kBluetoothOutOfBandPairingDataSize);
- memcpy(data_out.hash,
- reinterpret_cast<uint8_t*>(tmp_data->GetBuffer()),
- device::kBluetoothOutOfBandPairingDataSize);
-
- EXTENSION_FUNCTION_VALIDATE(data_in->GetBinary("randomizer", &tmp_data));
- EXTENSION_FUNCTION_VALIDATE(
- tmp_data->GetSize() == device::kBluetoothOutOfBandPairingDataSize);
- memcpy(data_out.randomizer,
- reinterpret_cast<uint8_t*>(tmp_data->GetBuffer()),
- device::kBluetoothOutOfBandPairingDataSize);
-
- device->SetOutOfBandPairingData(
- data_out,
- base::Bind(&BluetoothSetOutOfBandPairingDataFunction::OnSuccessCallback,
- this),
- base::Bind(&BluetoothSetOutOfBandPairingDataFunction::OnErrorCallback,
- this));
- } else {
- device->ClearOutOfBandPairingData(
- base::Bind(&BluetoothSetOutOfBandPairingDataFunction::OnSuccessCallback,
- this),
- base::Bind(&BluetoothSetOutOfBandPairingDataFunction::OnErrorCallback,
- this));
- }
-
- return true;
-}
-
-void BluetoothGetLocalOutOfBandPairingDataFunction::ReadCallback(
- const device::BluetoothOutOfBandPairingData& data) {
- base::BinaryValue* hash = base::BinaryValue::CreateWithCopiedBuffer(
- reinterpret_cast<const char*>(data.hash),
- device::kBluetoothOutOfBandPairingDataSize);
- base::BinaryValue* randomizer = base::BinaryValue::CreateWithCopiedBuffer(
- reinterpret_cast<const char*>(data.randomizer),
- device::kBluetoothOutOfBandPairingDataSize);
-
- // TODO(bryeung): convert to bluetooth::OutOfBandPairingData
- // when ArrayBuffer support within objects is completed.
- base::DictionaryValue* result = new base::DictionaryValue();
- result->Set("hash", hash);
- result->Set("randomizer", randomizer);
-
- SetResult(result);
-
- SendResponse(true);
-}
-
-void BluetoothGetLocalOutOfBandPairingDataFunction::ErrorCallback() {
- SetError(kCouldNotGetLocalOutOfBandPairingData);
- SendResponse(false);
-}
-
-bool BluetoothGetLocalOutOfBandPairingDataFunction::DoWork(
- scoped_refptr<BluetoothAdapter> adapter) {
- adapter->ReadLocalOutOfBandPairingData(
- base::Bind(&BluetoothGetLocalOutOfBandPairingDataFunction::ReadCallback,
- this),
- base::Bind(&BluetoothGetLocalOutOfBandPairingDataFunction::ErrorCallback,
- this));
-
- return true;
-}
-
void BluetoothStartDiscoveryFunction::OnSuccessCallback() {
SendResponse(true);
}
diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api.h b/chrome/browser/extensions/api/bluetooth/bluetooth_api.h
index ad89912..58122a7 100644
--- a/chrome/browser/extensions/api/bluetooth/bluetooth_api.h
+++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api.h
@@ -28,7 +28,6 @@ class BrowserContext;
namespace device {
class BluetoothAdapter;
-struct BluetoothOutOfBandPairingData;
}
namespace net {
@@ -256,38 +255,6 @@ class BluetoothGetSocketsFunction : public AsyncExtensionFunction {
virtual bool RunAsync() OVERRIDE;
};
-class BluetoothGetLocalOutOfBandPairingDataFunction
- : public BluetoothExtensionFunction {
- public:
- DECLARE_EXTENSION_FUNCTION("bluetooth.getLocalOutOfBandPairingData",
- BLUETOOTH_GETLOCALOUTOFBANDPAIRINGDATA)
-
- protected:
- virtual ~BluetoothGetLocalOutOfBandPairingDataFunction() {}
-
- void ReadCallback(const device::BluetoothOutOfBandPairingData& data);
- void ErrorCallback();
-
- // BluetoothExtensionFunction:
- virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) OVERRIDE;
-};
-
-class BluetoothSetOutOfBandPairingDataFunction
- : public BluetoothExtensionFunction {
- public:
- DECLARE_EXTENSION_FUNCTION("bluetooth.setOutOfBandPairingData",
- BLUETOOTH_SETOUTOFBANDPAIRINGDATA)
-
- protected:
- virtual ~BluetoothSetOutOfBandPairingDataFunction() {}
-
- void OnSuccessCallback();
- void OnErrorCallback();
-
- // BluetoothExtensionFunction:
- virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) OVERRIDE;
-};
-
class BluetoothStartDiscoveryFunction : public BluetoothExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("bluetooth.startDiscovery",
diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc
index a567584..da71a42 100644
--- a/chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc
+++ b/chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc
@@ -15,7 +15,6 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/ui_test_utils.h"
#include "device/bluetooth/bluetooth_adapter.h"
-#include "device/bluetooth/bluetooth_out_of_band_pairing_data.h"
#include "device/bluetooth/bluetooth_uuid.h"
#include "device/bluetooth/test/mock_bluetooth_adapter.h"
#include "device/bluetooth/test/mock_bluetooth_device.h"
@@ -27,7 +26,6 @@
using device::BluetoothAdapter;
using device::BluetoothDevice;
using device::BluetoothDiscoverySession;
-using device::BluetoothOutOfBandPairingData;
using device::BluetoothProfile;
using device::BluetoothUUID;
using device::MockBluetoothAdapter;
@@ -138,40 +136,11 @@ class TestBluetoothAddProfileFunction
BluetoothProfile* profile_;
};
-// This is the canonical UUID for the short UUID 0010.
-static const char kOutOfBandPairingDataHash[] = "0123456789ABCDEh";
-static const char kOutOfBandPairingDataRandomizer[] = "0123456789ABCDEr";
-
-static BluetoothOutOfBandPairingData GetOutOfBandPairingData() {
- BluetoothOutOfBandPairingData data;
- memcpy(&(data.hash), kOutOfBandPairingDataHash,
- device::kBluetoothOutOfBandPairingDataSize);
- memcpy(&(data.randomizer), kOutOfBandPairingDataRandomizer,
- device::kBluetoothOutOfBandPairingDataSize);
- return data;
-}
-
-static bool CallClosure(const base::Closure& callback) {
- callback.Run();
- return true;
-}
-
-static bool CallErrorClosure(const BluetoothDevice::ErrorCallback& callback) {
- callback.Run();
- return true;
-}
-
static void StopDiscoverySessionCallback(const base::Closure& callback,
const base::Closure& error_callback) {
callback.Run();
}
-static void CallOutOfBandPairingDataCallback(
- const BluetoothAdapter::BluetoothOutOfBandPairingDataCallback& callback,
- const BluetoothAdapter::ErrorCallback& error_callback) {
- callback.Run(GetOutOfBandPairingData());
-}
-
} // namespace
IN_PROC_BROWSER_TEST_F(BluetoothApiTest, Profiles) {
@@ -265,81 +234,6 @@ IN_PROC_BROWSER_TEST_F(BluetoothApiTest, GetAdapterState) {
EXPECT_EQ(kAdapterAddress, state.address);
}
-IN_PROC_BROWSER_TEST_F(BluetoothApiTest, GetLocalOutOfBandPairingData) {
- EXPECT_CALL(*mock_adapter_,
- ReadLocalOutOfBandPairingData(testing::_, testing::_))
- .WillOnce(testing::Invoke(CallOutOfBandPairingDataCallback));
-
- scoped_refptr<api::BluetoothGetLocalOutOfBandPairingDataFunction>
- get_oob_function(setupFunction(
- new api::BluetoothGetLocalOutOfBandPairingDataFunction));
-
- scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult(
- get_oob_function.get(), "[]", browser()));
-
- base::DictionaryValue* dict;
- EXPECT_TRUE(result->GetAsDictionary(&dict));
-
- base::BinaryValue* binary_value;
- EXPECT_TRUE(dict->GetBinary("hash", &binary_value));
- EXPECT_STREQ(kOutOfBandPairingDataHash,
- std::string(binary_value->GetBuffer(), binary_value->GetSize()).c_str());
- EXPECT_TRUE(dict->GetBinary("randomizer", &binary_value));
- EXPECT_STREQ(kOutOfBandPairingDataRandomizer,
- std::string(binary_value->GetBuffer(), binary_value->GetSize()).c_str());
-
- // Try again with an error
- testing::Mock::VerifyAndClearExpectations(mock_adapter_);
- EXPECT_CALL(*mock_adapter_,
- ReadLocalOutOfBandPairingData(
- testing::_,
- testing::Truly(CallClosure)));
-
- get_oob_function =
- setupFunction(new api::BluetoothGetLocalOutOfBandPairingDataFunction);
-
- std::string error(utils::RunFunctionAndReturnError(
- get_oob_function.get(), "[]", browser()));
- EXPECT_FALSE(error.empty());
-}
-
-IN_PROC_BROWSER_TEST_F(BluetoothApiTest, SetOutOfBandPairingData) {
- EXPECT_CALL(*mock_adapter_, GetDevice(device1_->GetAddress()))
- .WillOnce(testing::Return(device1_.get()));
- EXPECT_CALL(*device1_,
- ClearOutOfBandPairingData(testing::Truly(CallClosure),
- testing::_));
-
- std::string params = base::StringPrintf(
- "[{\"deviceAddress\":\"%s\"}]", device1_->GetAddress().c_str());
-
- scoped_refptr<api::BluetoothSetOutOfBandPairingDataFunction> set_oob_function;
- set_oob_function = setupFunction(
- new api::BluetoothSetOutOfBandPairingDataFunction);
- // There isn't actually a result.
- (void) utils::RunFunctionAndReturnSingleResult(
- set_oob_function.get(), params, browser());
-
- // Try again with an error
- testing::Mock::VerifyAndClearExpectations(mock_adapter_);
- testing::Mock::VerifyAndClearExpectations(device1_.get());
- EXPECT_CALL(*mock_adapter_, GetDevice(device1_->GetAddress()))
- .WillOnce(testing::Return(device1_.get()));
- EXPECT_CALL(
- *device1_,
- ClearOutOfBandPairingData(testing::_, testing::Truly(CallErrorClosure)));
-
- set_oob_function = setupFunction(
- new api::BluetoothSetOutOfBandPairingDataFunction);
- std::string error(utils::RunFunctionAndReturnError(
- set_oob_function.get(), params, browser()));
- EXPECT_FALSE(error.empty());
-
- // TODO(bryeung): Also test setting the data when there is support for
- // ArrayBuffers in the arguments to the RunFunctionAnd* methods.
- // crbug.com/132796
-}
-
IN_PROC_BROWSER_TEST_F(BluetoothApiTest, DeviceEvents) {
ResultCatcher catcher;
catcher.RestrictToProfile(browser()->profile());
diff --git a/chrome/common/extensions/api/bluetooth.idl b/chrome/common/extensions/api/bluetooth.idl
index cebbf80..65a6e2b 100644
--- a/chrome/common/extensions/api/bluetooth.idl
+++ b/chrome/common/extensions/api/bluetooth.idl
@@ -166,16 +166,6 @@ namespace bluetooth {
boolean paused;
};
- dictionary OutOfBandPairingData {
- // Simple Pairing Hash C.
- // Always 16 octets long.
- ArrayBuffer hash;
-
- // Simple Pairing Randomizer R.
- // Always 16 octets long.
- ArrayBuffer randomizer;
- };
-
callback AdapterStateCallback = void(AdapterState result);
callback AddressCallback = void(DOMString result);
callback BooleanCallback = void(boolean result);
@@ -183,7 +173,6 @@ namespace bluetooth {
callback DeviceCallback = void(Device result);
callback DevicesCallback = void(Device[] result);
callback NameCallback = void(DOMString result);
- callback OutOfBandPairingDataCallback = void(OutOfBandPairingData data);
callback ResultCallback = void();
callback SizeCallback = void(long result);
callback SocketCallback = void(Socket result);
@@ -203,17 +192,6 @@ namespace bluetooth {
long socketId;
};
- // Options for the setOutOfBandPairingData function.
- dictionary SetOutOfBandPairingDataOptions {
- // The address of the remote device that the data should be associated
- // with. |deviceAddress| should be in the format 'XX:XX:XX:XX:XX:XX'.
- DOMString address;
-
- // The Out Of Band Pairing Data. If this is omitted, the data for the
- // device is cleared instead.
- OutOfBandPairingData? data;
- };
-
// Callback from the <code>getSocket</code> method.
// |socket| : Object containing the socket information.
callback GetSocketCallback = void (Socket socket);
@@ -325,18 +303,6 @@ namespace bluetooth {
// |callback| : Called when the list of sockets is available.
static void getSockets(GetSocketsCallback callback);
- // Get the local Out of Band Pairing data.
- // |callback| : Called with the data.
- static void getLocalOutOfBandPairingData(
- OutOfBandPairingDataCallback callback);
-
- // Set the Out of Band Pairing data for a remote device.
- // Any previous Out Of Band Pairing Data for this device is overwritten.
- // |options| : The options for this function.
- // |callback| : Called to indicate success or failure.
- static void setOutOfBandPairingData(SetOutOfBandPairingDataOptions options,
- optional ResultCallback callback);
-
// Start discovery. Newly discovered devices will be returned via the
// onDeviceAdded event. Previously discovered devices already known to
// the adapter must be obtained using getDevices and will only be updated
diff --git a/device/bluetooth/bluetooth.gyp b/device/bluetooth/bluetooth.gyp
index 5aafd1d..d5498fd 100644
--- a/device/bluetooth/bluetooth.gyp
+++ b/device/bluetooth/bluetooth.gyp
@@ -49,7 +49,6 @@
'bluetooth_gatt_service.h',
'bluetooth_init_win.cc',
'bluetooth_init_win.h',
- 'bluetooth_out_of_band_pairing_data.h',
'bluetooth_pairing_chromeos.cc',
'bluetooth_pairing_chromeos.h',
'bluetooth_profile.cc',
diff --git a/device/bluetooth/bluetooth_adapter.h b/device/bluetooth/bluetooth_adapter.h
index 9323ff7..fcd67b5 100644
--- a/device/bluetooth/bluetooth_adapter.h
+++ b/device/bluetooth/bluetooth_adapter.h
@@ -22,8 +22,6 @@ class BluetoothDiscoverySession;
class BluetoothSocket;
class BluetoothUUID;
-struct BluetoothOutOfBandPairingData;
-
// BluetoothAdapter represents a local Bluetooth adapter which may be used to
// interact with remote Bluetooth devices. As well as providing support for
// determining whether an adapter is present and whether the radio is powered,
@@ -85,11 +83,6 @@ class BluetoothAdapter : public base::RefCounted<BluetoothAdapter> {
// called, in the success case the callback is simply not called.
typedef base::Closure ErrorCallback;
- // The BluetoothOutOfBandPairingDataCallback is used to return
- // BluetoothOutOfBandPairingData to the caller.
- typedef base::Callback<void(const BluetoothOutOfBandPairingData& data)>
- BluetoothOutOfBandPairingDataCallback;
-
// The InitCallback is used to trigger a callback after asynchronous
// initialization, if initialization is asynchronous on the platform.
typedef base::Callback<void()> InitCallback;
@@ -193,11 +186,6 @@ class BluetoothAdapter : public base::RefCounted<BluetoothAdapter> {
virtual BluetoothDevice* GetDevice(const std::string& address);
virtual const BluetoothDevice* GetDevice(const std::string& address) const;
- // Requests the local Out Of Band pairing data.
- virtual void ReadLocalOutOfBandPairingData(
- const BluetoothOutOfBandPairingDataCallback& callback,
- const ErrorCallback& error_callback) = 0;
-
// Possible priorities for AddPairingDelegate(), low is intended for
// permanent UI and high is intended for interactive UI or applications.
enum PairingDelegatePriority {
diff --git a/device/bluetooth/bluetooth_adapter_chromeos.cc b/device/bluetooth/bluetooth_adapter_chromeos.cc
index 1519209..0f60293 100644
--- a/device/bluetooth/bluetooth_adapter_chromeos.cc
+++ b/device/bluetooth/bluetooth_adapter_chromeos.cc
@@ -231,12 +231,6 @@ bool BluetoothAdapterChromeOS::IsDiscovering() const {
return properties->discovering.value();
}
-void BluetoothAdapterChromeOS::ReadLocalOutOfBandPairingData(
- const BluetoothAdapter::BluetoothOutOfBandPairingDataCallback& callback,
- const ErrorCallback& error_callback) {
- error_callback.Run();
-}
-
void BluetoothAdapterChromeOS::CreateRfcommService(
const BluetoothUUID& uuid,
int channel,
diff --git a/device/bluetooth/bluetooth_adapter_chromeos.h b/device/bluetooth/bluetooth_adapter_chromeos.h
index db7c0e8..a8ad4cd 100644
--- a/device/bluetooth/bluetooth_adapter_chromeos.h
+++ b/device/bluetooth/bluetooth_adapter_chromeos.h
@@ -62,10 +62,6 @@ class BluetoothAdapterChromeOS
const base::Closure& callback,
const ErrorCallback& error_callback) OVERRIDE;
virtual bool IsDiscovering() const OVERRIDE;
- virtual void ReadLocalOutOfBandPairingData(
- const device::BluetoothAdapter::BluetoothOutOfBandPairingDataCallback&
- callback,
- const ErrorCallback& error_callback) OVERRIDE;
virtual void CreateRfcommService(
const device::BluetoothUUID& uuid,
int channel,
diff --git a/device/bluetooth/bluetooth_adapter_mac.h b/device/bluetooth/bluetooth_adapter_mac.h
index 0f0414e..c841481 100644
--- a/device/bluetooth/bluetooth_adapter_mac.h
+++ b/device/bluetooth/bluetooth_adapter_mac.h
@@ -58,9 +58,6 @@ class BluetoothAdapterMac : public BluetoothAdapter {
const base::Closure& callback,
const ErrorCallback& error_callback) OVERRIDE;
virtual bool IsDiscovering() const OVERRIDE;
- virtual void ReadLocalOutOfBandPairingData(
- const BluetoothOutOfBandPairingDataCallback& callback,
- const ErrorCallback& error_callback) OVERRIDE;
virtual void CreateRfcommService(
const BluetoothUUID& uuid,
int channel,
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
index 88ab18a..6fb2b44 100644
--- a/device/bluetooth/bluetooth_adapter_mac.mm
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
@@ -175,11 +175,6 @@ bool BluetoothAdapterMac::IsDiscovering() const {
discovery_status_ == DISCOVERY_STOPPING;
}
-void BluetoothAdapterMac::ReadLocalOutOfBandPairingData(
- const BluetoothOutOfBandPairingDataCallback& callback,
- const ErrorCallback& error_callback) {
-}
-
void BluetoothAdapterMac::CreateRfcommService(
const BluetoothUUID& uuid,
int channel,
diff --git a/device/bluetooth/bluetooth_adapter_unittest.cc b/device/bluetooth/bluetooth_adapter_unittest.cc
index 92efc0f..5478646 100644
--- a/device/bluetooth/bluetooth_adapter_unittest.cc
+++ b/device/bluetooth/bluetooth_adapter_unittest.cc
@@ -74,11 +74,6 @@ class TestBluetoothAdapter : public BluetoothAdapter {
const ErrorCallback& error_callback) OVERRIDE {
}
- virtual void ReadLocalOutOfBandPairingData(
- const BluetoothAdapter::BluetoothOutOfBandPairingDataCallback& callback,
- const ErrorCallback& error_callback) OVERRIDE {
- }
-
virtual void CreateRfcommService(
const BluetoothUUID& uuid,
int channel,
diff --git a/device/bluetooth/bluetooth_adapter_win.cc b/device/bluetooth/bluetooth_adapter_win.cc
index 0b85a29..6bbdb05 100644
--- a/device/bluetooth/bluetooth_adapter_win.cc
+++ b/device/bluetooth/bluetooth_adapter_win.cc
@@ -161,12 +161,6 @@ void BluetoothAdapterWin::DiscoveryStopped() {
MaybePostStartDiscoveryTask();
}
-void BluetoothAdapterWin::ReadLocalOutOfBandPairingData(
- const BluetoothOutOfBandPairingDataCallback& callback,
- const ErrorCallback& error_callback) {
- NOTIMPLEMENTED();
-}
-
void BluetoothAdapterWin::CreateRfcommService(
const BluetoothUUID& uuid,
int channel,
diff --git a/device/bluetooth/bluetooth_adapter_win.h b/device/bluetooth/bluetooth_adapter_win.h
index ba9bb52..cc9007a 100644
--- a/device/bluetooth/bluetooth_adapter_win.h
+++ b/device/bluetooth/bluetooth_adapter_win.h
@@ -55,9 +55,6 @@ class BluetoothAdapterWin : public BluetoothAdapter,
const base::Closure& callback,
const ErrorCallback& error_callback) OVERRIDE;
virtual bool IsDiscovering() const OVERRIDE;
- virtual void ReadLocalOutOfBandPairingData(
- const BluetoothOutOfBandPairingDataCallback& callback,
- const ErrorCallback& error_callback) OVERRIDE;
virtual void CreateRfcommService(
const BluetoothUUID& uuid,
int channel,
diff --git a/device/bluetooth/bluetooth_device.h b/device/bluetooth/bluetooth_device.h
index 3c17231..a495b20 100644
--- a/device/bluetooth/bluetooth_device.h
+++ b/device/bluetooth/bluetooth_device.h
@@ -23,8 +23,6 @@ class BluetoothProfile;
class BluetoothSocket;
class BluetoothUUID;
-struct BluetoothOutOfBandPairingData;
-
// BluetoothDevice represents a remote Bluetooth device, both its properties and
// capabilities as discovered by a local adapter and actions that may be
// performed on the remove device such as pairing, connection and disconnection.
@@ -395,19 +393,6 @@ class BluetoothDevice {
const ConnectToServiceCallback& callback,
const ConnectToServiceErrorCallback& error_callback) = 0;
- // Sets the Out Of Band pairing data for this device to |data|. Exactly one
- // of |callback| or |error_callback| will be run.
- virtual void SetOutOfBandPairingData(
- const BluetoothOutOfBandPairingData& data,
- const base::Closure& callback,
- const ErrorCallback& error_callback) = 0;
-
- // Clears the Out Of Band pairing data for this device. Exactly one of
- // |callback| or |error_callback| will be run.
- virtual void ClearOutOfBandPairingData(
- const base::Closure& callback,
- const ErrorCallback& error_callback) = 0;
-
// Starts monitoring the connection properties, RSSI and TX power. These
// properties will be tracked, and updated when their values change. Exactly
// one of |callback| or |error_callback| will be run.
diff --git a/device/bluetooth/bluetooth_device_chromeos.cc b/device/bluetooth/bluetooth_device_chromeos.cc
index e56f907..1c84c41 100644
--- a/device/bluetooth/bluetooth_device_chromeos.cc
+++ b/device/bluetooth/bluetooth_device_chromeos.cc
@@ -458,21 +458,6 @@ void BluetoothDeviceChromeOS::ConnectToService(
error_callback);
}
-void BluetoothDeviceChromeOS::SetOutOfBandPairingData(
- const device::BluetoothOutOfBandPairingData& data,
- const base::Closure& callback,
- const ErrorCallback& error_callback) {
- // TODO(keybuk): implement
- error_callback.Run();
-}
-
-void BluetoothDeviceChromeOS::ClearOutOfBandPairingData(
- const base::Closure& callback,
- const ErrorCallback& error_callback) {
- // TODO(keybuk): implement
- error_callback.Run();
-}
-
void BluetoothDeviceChromeOS::StartConnectionMonitor(
const base::Closure& callback,
const ErrorCallback& error_callback) {
diff --git a/device/bluetooth/bluetooth_device_chromeos.h b/device/bluetooth/bluetooth_device_chromeos.h
index c60a4de..6f003b4 100644
--- a/device/bluetooth/bluetooth_device_chromeos.h
+++ b/device/bluetooth/bluetooth_device_chromeos.h
@@ -75,13 +75,6 @@ class BluetoothDeviceChromeOS
const device::BluetoothUUID& uuid,
const ConnectToServiceCallback& callback,
const ConnectToServiceErrorCallback& error_callback) OVERRIDE;
- virtual void SetOutOfBandPairingData(
- const device::BluetoothOutOfBandPairingData& data,
- const base::Closure& callback,
- const ErrorCallback& error_callback) OVERRIDE;
- virtual void ClearOutOfBandPairingData(
- const base::Closure& callback,
- const ErrorCallback& error_callback) OVERRIDE;
virtual void StartConnectionMonitor(
const base::Closure& callback,
const ErrorCallback& error_callback) OVERRIDE;
diff --git a/device/bluetooth/bluetooth_device_mac.h b/device/bluetooth/bluetooth_device_mac.h
index d0668f6..bfa587e 100644
--- a/device/bluetooth/bluetooth_device_mac.h
+++ b/device/bluetooth/bluetooth_device_mac.h
@@ -66,13 +66,6 @@ class BluetoothDeviceMac : public BluetoothDevice {
const BluetoothUUID& uuid,
const ConnectToServiceCallback& callback,
const ConnectToServiceErrorCallback& error_callback) OVERRIDE;
- virtual void SetOutOfBandPairingData(
- const BluetoothOutOfBandPairingData& data,
- const base::Closure& callback,
- const ErrorCallback& error_callback) OVERRIDE;
- virtual void ClearOutOfBandPairingData(
- const base::Closure& callback,
- const ErrorCallback& error_callback) OVERRIDE;
virtual void StartConnectionMonitor(
const base::Closure& callback,
const ErrorCallback& error_callback) OVERRIDE;
diff --git a/device/bluetooth/bluetooth_device_mac.mm b/device/bluetooth/bluetooth_device_mac.mm
index e8af48a..25c8134 100644
--- a/device/bluetooth/bluetooth_device_mac.mm
+++ b/device/bluetooth/bluetooth_device_mac.mm
@@ -13,7 +13,6 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/sys_string_conversions.h"
-#include "device/bluetooth/bluetooth_out_of_band_pairing_data.h"
#include "device/bluetooth/bluetooth_profile_mac.h"
#include "device/bluetooth/bluetooth_service_record_mac.h"
#include "device/bluetooth/bluetooth_socket_mac.h"
@@ -209,19 +208,6 @@ void BluetoothDeviceMac::ConnectToService(
NOTIMPLEMENTED();
}
-void BluetoothDeviceMac::SetOutOfBandPairingData(
- const BluetoothOutOfBandPairingData& data,
- const base::Closure& callback,
- const ErrorCallback& error_callback) {
- NOTIMPLEMENTED();
-}
-
-void BluetoothDeviceMac::ClearOutOfBandPairingData(
- const base::Closure& callback,
- const ErrorCallback& error_callback) {
- NOTIMPLEMENTED();
-}
-
void BluetoothDeviceMac::StartConnectionMonitor(
const base::Closure& callback,
const ErrorCallback& error_callback) {
diff --git a/device/bluetooth/bluetooth_device_win.cc b/device/bluetooth/bluetooth_device_win.cc
index d5e9e77..40a8fa8 100644
--- a/device/bluetooth/bluetooth_device_win.cc
+++ b/device/bluetooth/bluetooth_device_win.cc
@@ -11,7 +11,6 @@
#include "base/memory/scoped_vector.h"
#include "base/sequenced_task_runner.h"
#include "base/strings/stringprintf.h"
-#include "device/bluetooth/bluetooth_out_of_band_pairing_data.h"
#include "device/bluetooth/bluetooth_profile_win.h"
#include "device/bluetooth/bluetooth_service_record_win.h"
#include "device/bluetooth/bluetooth_socket_thread.h"
@@ -221,19 +220,6 @@ void BluetoothDeviceWin::ConnectToService(
NOTIMPLEMENTED();
}
-void BluetoothDeviceWin::SetOutOfBandPairingData(
- const BluetoothOutOfBandPairingData& data,
- const base::Closure& callback,
- const ErrorCallback& error_callback) {
- NOTIMPLEMENTED();
-}
-
-void BluetoothDeviceWin::ClearOutOfBandPairingData(
- const base::Closure& callback,
- const ErrorCallback& error_callback) {
- NOTIMPLEMENTED();
-}
-
void BluetoothDeviceWin::StartConnectionMonitor(
const base::Closure& callback,
const ErrorCallback& error_callback) {
diff --git a/device/bluetooth/bluetooth_device_win.h b/device/bluetooth/bluetooth_device_win.h
index 0a019c5..d558195 100644
--- a/device/bluetooth/bluetooth_device_win.h
+++ b/device/bluetooth/bluetooth_device_win.h
@@ -72,13 +72,6 @@ class BluetoothDeviceWin : public BluetoothDevice {
const BluetoothUUID& uuid,
const ConnectToServiceCallback& callback,
const ConnectToServiceErrorCallback& error_callback) OVERRIDE;
- virtual void SetOutOfBandPairingData(
- const BluetoothOutOfBandPairingData& data,
- const base::Closure& callback,
- const ErrorCallback& error_callback) OVERRIDE;
- virtual void ClearOutOfBandPairingData(
- const base::Closure& callback,
- const ErrorCallback& error_callback) OVERRIDE;
virtual void StartConnectionMonitor(
const base::Closure& callback,
const ErrorCallback& error_callback) OVERRIDE;
diff --git a/device/bluetooth/bluetooth_out_of_band_pairing_data.h b/device/bluetooth/bluetooth_out_of_band_pairing_data.h
deleted file mode 100644
index 1b45bb0..0000000
--- a/device/bluetooth/bluetooth_out_of_band_pairing_data.h
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef DEVICE_BLUETOOTH_BLUETOOTH_OUT_OF_BAND_PAIRING_DATA_H_
-#define DEVICE_BLUETOOTH_BLUETOOTH_OUT_OF_BAND_PAIRING_DATA_H_
-
-#include "base/basictypes.h"
-
-namespace device {
-
-const size_t kBluetoothOutOfBandPairingDataSize = 16;
-
-// A simple structure representing the data required to perform Out Of Band
-// Pairing. See
-// http://mclean-linsky.net/joel/cv/Simple%20Pairing_WP_V10r00.pdf
-struct BluetoothOutOfBandPairingData {
- // Simple Pairing Hash C.
- uint8 hash[kBluetoothOutOfBandPairingDataSize];
-
- // Simple Pairing Randomizer R.
- uint8 randomizer[kBluetoothOutOfBandPairingDataSize];
-};
-
-} // namespace device
-
-#endif // DEVICE_BLUETOOTH_BLUETOOTH_OUT_OF_BAND_PAIRING_DATA_H_
diff --git a/device/bluetooth/test/mock_bluetooth_adapter.h b/device/bluetooth/test/mock_bluetooth_adapter.h
index ab0e47b..0326192 100644
--- a/device/bluetooth/test/mock_bluetooth_adapter.h
+++ b/device/bluetooth/test/mock_bluetooth_adapter.h
@@ -60,10 +60,6 @@ class MockBluetoothAdapter : public BluetoothAdapter {
MOCK_METHOD1(GetDevice, BluetoothDevice*(const std::string& address));
MOCK_CONST_METHOD1(GetDevice,
const BluetoothDevice*(const std::string& address));
- MOCK_METHOD2(
- ReadLocalOutOfBandPairingData,
- void(const BluetoothOutOfBandPairingDataCallback& callback,
- const ErrorCallback& error_callback));
MOCK_METHOD2(AddPairingDelegate,
void(BluetoothDevice::PairingDelegate* pairing_delegate,
enum PairingDelegatePriority priority));
diff --git a/device/bluetooth/test/mock_bluetooth_device.h b/device/bluetooth/test/mock_bluetooth_device.h
index e624f9a..cf52d51 100644
--- a/device/bluetooth/test/mock_bluetooth_device.h
+++ b/device/bluetooth/test/mock_bluetooth_device.h
@@ -9,7 +9,6 @@
#include "base/strings/string16.h"
#include "device/bluetooth/bluetooth_device.h"
-#include "device/bluetooth/bluetooth_out_of_band_pairing_data.h"
#include "device/bluetooth/bluetooth_uuid.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -72,13 +71,6 @@ class MockBluetoothDevice : public BluetoothDevice {
const ConnectToServiceCallback& callback,
const ConnectToServiceErrorCallback& error_callback));
- MOCK_METHOD3(SetOutOfBandPairingData,
- void(const BluetoothOutOfBandPairingData& data,
- const base::Closure& callback,
- const BluetoothDevice::ErrorCallback& error_callback));
- MOCK_METHOD2(ClearOutOfBandPairingData,
- void(const base::Closure& callback,
- const BluetoothDevice::ErrorCallback& error_callback));
MOCK_METHOD2(StartConnectionMonitor,
void(const base::Closure& callback,
const BluetoothDevice::ErrorCallback& error_callback));