OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_PROXIMITY_AUTH_CONNECTION_FINDER_H | 5 #ifndef COMPONENTS_CRYPTAUTH_CONNECTION_FINDER_H |
6 #define COMPONENTS_PROXIMITY_AUTH_CONNECTION_FINDER_H | 6 #define COMPONENTS_CRYPTAUTH_CONNECTION_FINDER_H |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "components/cryptauth/connection.h" |
12 | 13 |
13 namespace proximity_auth { | 14 namespace cryptauth { |
14 | |
15 class Connection; | |
16 | 15 |
17 // Interface for finding a connection to a remote device. | 16 // Interface for finding a connection to a remote device. |
18 class ConnectionFinder { | 17 class ConnectionFinder { |
19 public: | 18 public: |
20 virtual ~ConnectionFinder() {} | 19 virtual ~ConnectionFinder() {} |
21 | 20 |
22 // Attempts to find a connection to a remote device. The finder will try to | 21 // Attempts to find a connection to a remote device. The finder will try to |
23 // find the connection indefinitely until the finder is destroyed. Calls | 22 // find the connection indefinitely until the finder is destroyed. Calls |
24 // |connection_callback| with the open connection once the remote device is | 23 // |connection_callback| with the open connection once the remote device is |
25 // connected. | 24 // connected. |
26 // TODO(isherman): Can this just be done as part of the constructor? | 25 // TODO(isherman): Can this just be done as part of the constructor? |
27 typedef base::Callback<void(std::unique_ptr<Connection> connection)> | 26 typedef base::Callback<void(std::unique_ptr<Connection> connection)> |
28 ConnectionCallback; | 27 ConnectionCallback; |
29 virtual void Find(const ConnectionCallback& connection_callback) = 0; | 28 virtual void Find(const ConnectionCallback& connection_callback) = 0; |
30 }; | 29 }; |
31 | 30 |
32 } // namespace proximity_auth | 31 } // namespace cryptauth |
33 | 32 |
34 #endif // COMPONENTS_PROXIMITY_AUTH_CONNECTION_FINDER_H | 33 #endif // COMPONENTS_CRYPTAUTH_CONNECTION_FINDER_H |
OLD | NEW |