Implement finding BLE connections in chrome://proximity-auth.
[chromium-blink-merge.git] / components / proximity_auth / connection_finder.h
blob246a9a0d0351a0ca35c804a81adce036246b30c6
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.
5 #ifndef COMPONENTS_PROXIMITY_AUTH_CONNECTION_FINDER_H
6 #define COMPONENTS_PROXIMITY_AUTH_CONNECTION_FINDER_H
8 #include "base/callback_forward.h"
9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
12 namespace proximity_auth {
14 class Connection;
16 // Interface for finding a connection to a remote device.
17 class ConnectionFinder {
18 public:
19 virtual ~ConnectionFinder() {}
21 // Attempts to find a connection to a remote device. The finder will try to
22 // find the connection indefinitely until the finder is destroyed. Calls
23 // |connection_callback| with the open connection once the remote device is
24 // connected.
25 // TODO(isherman): Can this just be done as part of the constructor?
26 typedef base::Callback<void(scoped_ptr<Connection> connection)>
27 ConnectionCallback;
28 virtual void Find(const ConnectionCallback& connection_callback) = 0;
31 } // namespace proximity_auth
33 #endif // COMPONENTS_PROXIMITY_AUTH_CONNECTION_FINDER_H