Chromium Code Reviews| Index: components/proximity_auth/bluetooth_low_energy_setup_connection_finder.h |
| diff --git a/components/proximity_auth/bluetooth_low_energy_setup_connection_finder.h b/components/proximity_auth/bluetooth_low_energy_setup_connection_finder.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3b93a72f9a8489cef41537e584eef2ac6c5dd716 |
| --- /dev/null |
| +++ b/components/proximity_auth/bluetooth_low_energy_setup_connection_finder.h |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
|
Tim Song
2017/04/28 05:32:20
nit: update date
sacomoto
2017/04/28 06:59:01
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_SETUP_CONNECTION_FINDER_H |
| +#define COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_SETUP_CONNECTION_FINDER_H |
| + |
| +#include <string> |
| + |
| +#include "base/macros.h" |
| +#include "components/cryptauth/bluetooth_throttler.h" |
| +#include "components/cryptauth/remote_device.h" |
| +#include "components/proximity_auth/bluetooth_low_energy_connection_finder.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. |
| + // |bluetooth_throttler|: The reconnection throttler. |
| + BluetoothLowEnergySetupConnectionFinder( |
| + const std::string& remote_service_uuid, |
| + cryptauth::BluetoothThrottler* bluetooth_throttler); |
| + |
| + 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 // COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_SETUP_CONNECTION_FINDER_H |