Commit b01bada3 authored by James Hawkins's avatar James Hawkins Committed by Commit Bot

Smart Lock: Remove unused BleSetupConnectionFinder.

R=hansberry@chromium.org

Bug: 899324
Test: none
Change-Id: Ib2089db12d37b7da709909dd797a695a2f1e8a8d
Reviewed-on: https://chromium-review.googlesource.com/c/1324872Reviewed-by: default avatarRyan Hansberry <hansberry@chromium.org>
Commit-Queue: James Hawkins <jhawkins@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606527}
parent ba46f11f
......@@ -10,8 +10,6 @@ static_library("proximity_auth") {
sources = [
"bluetooth_low_energy_connection_finder.cc",
"bluetooth_low_energy_connection_finder.h",
"bluetooth_low_energy_setup_connection_finder.cc",
"bluetooth_low_energy_setup_connection_finder.h",
"messenger.h",
"messenger_impl.cc",
"messenger_impl.h",
......
// Copyright 2017 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.
#include "chromeos/components/proximity_auth/bluetooth_low_energy_setup_connection_finder.h"
#include <string>
#include <memory>
#include "base/memory/ptr_util.h"
#include "chromeos/components/proximity_auth/logging/logging.h"
#include "components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.h"
#include "components/cryptauth/connection.h"
#include "components/cryptauth/remote_device.h"
#include "components/cryptauth/remote_device_ref.h"
#include "device/bluetooth/bluetooth_device.h"
#include "device/bluetooth/bluetooth_uuid.h"
using device::BluetoothDevice;
namespace proximity_auth {
BluetoothLowEnergySetupConnectionFinder::
BluetoothLowEnergySetupConnectionFinder(
const std::string& remote_service_uuid)
: BluetoothLowEnergyConnectionFinder(
cryptauth::RemoteDeviceRef(
std::make_shared<cryptauth::RemoteDevice>()),
remote_service_uuid,
std::make_unique<cryptauth::BackgroundEidGenerator>()),
remote_service_uuid_(device::BluetoothUUID(remote_service_uuid)) {}
bool BluetoothLowEnergySetupConnectionFinder::IsRightDevice(
BluetoothDevice* device) {
if (!device)
return false;
BluetoothDevice::UUIDSet uuids = device->GetUUIDs();
return base::ContainsKey(uuids, remote_service_uuid_);
}
} // namespace proximity_auth
// Copyright 2017 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 CHROMEOS_COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_SETUP_CONNECTION_FINDER_H_
#define CHROMEOS_COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_SETUP_CONNECTION_FINDER_H_
#include <string>
#include "base/macros.h"
#include "chromeos/components/proximity_auth/bluetooth_low_energy_connection_finder.h"
#include "components/cryptauth/remote_device_ref.h"
#include "device/bluetooth/bluetooth_device.h"
namespace proximity_auth {
// This cryptauth::ConnectionFinder implementation is specialized in finding a
// Bluetooth Low Energy remote device based on the advertised service UUID.
class BluetoothLowEnergySetupConnectionFinder
: public BluetoothLowEnergyConnectionFinder {
public:
// Finds (and connects) to a Bluetooth low energy device, based on the UUID
// advertised by the remote device.
//
// |remote_service_uuid|: The UUID of the service used to send/receive data in
// remote device.
BluetoothLowEnergySetupConnectionFinder(
const std::string& remote_service_uuid);
private:
// Checks if |device| is the right device, that is is adversing tthe right
// service UUID.
bool IsRightDevice(device::BluetoothDevice* device) override;
// The UUID of the service advertised by the remote device.
device::BluetoothUUID remote_service_uuid_;
DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergySetupConnectionFinder);
};
} // namespace proximity_auth
#endif // CHROMEOS_COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_SETUP_CONNECTION_FINDER_H_
......@@ -29,7 +29,6 @@ class TetherHostFetcherImplTest;
} // namespace chromeos
namespace proximity_auth {
class BluetoothLowEnergySetupConnectionFinder;
class ProximityAuthWebUIHandler;
} // namespace proximity_auth
......@@ -102,7 +101,6 @@ class RemoteDeviceRef {
friend class chromeos::tether::TetherHostFetcherImpl;
friend class chromeos::tether::TetherHostFetcherImplTest;
friend class proximity_auth::ProximityAuthWebUIHandler;
friend class proximity_auth::BluetoothLowEnergySetupConnectionFinder;
explicit RemoteDeviceRef(std::shared_ptr<RemoteDevice> remote_device);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment