OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_PROXIMITY_AUTH_CLIENT_H_ | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_CLIENT_H_ |
6 #define COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_CLIENT_H_ | 6 #define COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_CLIENT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "components/proximity_auth/cryptauth/proto/cryptauth_api.pb.h" | 12 #include "components/cryptauth/proto/cryptauth_api.pb.h" |
13 #include "components/proximity_auth/screenlock_state.h" | 13 #include "components/proximity_auth/screenlock_state.h" |
14 | 14 |
15 class PrefService; | 15 class PrefService; |
16 | 16 |
17 namespace proximity_auth { | 17 namespace cryptauth { |
18 | |
19 class CryptAuthClientFactory; | 18 class CryptAuthClientFactory; |
20 class CryptAuthDeviceManager; | 19 class CryptAuthDeviceManager; |
21 class CryptAuthEnrollmentManager; | 20 class CryptAuthEnrollmentManager; |
22 class SecureMessageDelegate; | 21 class SecureMessageDelegate; |
| 22 } |
| 23 |
| 24 namespace proximity_auth { |
23 | 25 |
24 // An interface that needs to be supplied to the Proximity Auth component by its | 26 // An interface that needs to be supplied to the Proximity Auth component by its |
25 // embedder. There should be one |ProximityAuthClient| per | 27 // embedder. There should be one |ProximityAuthClient| per |
26 // |content::BrowserContext|. | 28 // |content::BrowserContext|. |
27 class ProximityAuthClient { | 29 class ProximityAuthClient { |
28 public: | 30 public: |
29 virtual ~ProximityAuthClient() {} | 31 virtual ~ProximityAuthClient() {} |
30 | 32 |
31 // Returns the authenticated username. | 33 // Returns the authenticated username. |
32 virtual std::string GetAuthenticatedUsername() const = 0; | 34 virtual std::string GetAuthenticatedUsername() const = 0; |
(...skipping 19 matching lines...) Expand all Loading... |
52 virtual void GetChallengeForUserAndDevice( | 54 virtual void GetChallengeForUserAndDevice( |
53 const std::string& user_id, | 55 const std::string& user_id, |
54 const std::string& remote_public_key, | 56 const std::string& remote_public_key, |
55 const std::string& channel_binding_data, | 57 const std::string& channel_binding_data, |
56 base::Callback<void(const std::string& challenge)> callback) = 0; | 58 base::Callback<void(const std::string& challenge)> callback) = 0; |
57 | 59 |
58 // Returns the PrefService used by the profile. | 60 // Returns the PrefService used by the profile. |
59 virtual PrefService* GetPrefService() = 0; | 61 virtual PrefService* GetPrefService() = 0; |
60 | 62 |
61 // Returns the SecureMessageDelegate used by the system. | 63 // Returns the SecureMessageDelegate used by the system. |
62 virtual std::unique_ptr<SecureMessageDelegate> | 64 virtual std::unique_ptr<cryptauth::SecureMessageDelegate> |
63 CreateSecureMessageDelegate() = 0; | 65 CreateSecureMessageDelegate() = 0; |
64 | 66 |
65 // Constructs the CryptAuthClientFactory that can be used for API requests. | 67 // Constructs the CryptAuthClientFactory that can be used for API requests. |
66 virtual std::unique_ptr<CryptAuthClientFactory> | 68 virtual std::unique_ptr<cryptauth::CryptAuthClientFactory> |
67 CreateCryptAuthClientFactory() = 0; | 69 CreateCryptAuthClientFactory() = 0; |
68 | 70 |
69 // Constructs the DeviceClassifier message that is sent to CryptAuth for all | 71 // Constructs the DeviceClassifier message that is sent to CryptAuth for all |
70 // API requests. | 72 // API requests. |
71 virtual cryptauth::DeviceClassifier GetDeviceClassifier() = 0; | 73 virtual cryptauth::DeviceClassifier GetDeviceClassifier() = 0; |
72 | 74 |
73 // Returns the account id of the user. | 75 // Returns the account id of the user. |
74 virtual std::string GetAccountId() = 0; | 76 virtual std::string GetAccountId() = 0; |
75 | 77 |
76 virtual proximity_auth::CryptAuthEnrollmentManager* | 78 virtual cryptauth::CryptAuthEnrollmentManager* |
77 GetCryptAuthEnrollmentManager() = 0; | 79 GetCryptAuthEnrollmentManager() = 0; |
78 | 80 |
79 virtual proximity_auth::CryptAuthDeviceManager* | 81 virtual cryptauth::CryptAuthDeviceManager* GetCryptAuthDeviceManager() = 0; |
80 GetCryptAuthDeviceManager() = 0; | |
81 }; | 82 }; |
82 | 83 |
83 } // namespace proximity_auth | 84 } // namespace proximity_auth |
84 | 85 |
85 #endif // COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_CLIENT_H_ | 86 #endif // COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_CLIENT_H_ |
OLD | NEW |