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 CHROME_BROWSER_SIGNIN_CHROME_PROXIMITY_AUTH_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_CHROME_PROXIMITY_AUTH_CLIENT_H_ |
6 #define CHROME_BROWSER_SIGNIN_CHROME_PROXIMITY_AUTH_CLIENT_H_ | 6 #define CHROME_BROWSER_SIGNIN_CHROME_PROXIMITY_AUTH_CLIENT_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "components/proximity_auth/proximity_auth_client.h" | 9 #include "components/proximity_auth/proximity_auth_client.h" |
10 | 10 |
11 class PrefService; | 11 class PrefService; |
12 class Profile; | 12 class Profile; |
13 class EasyUnlockServiceRegular; | 13 class EasyUnlockServiceRegular; |
14 | 14 |
15 // A Chrome-specific implementation of the ProximityAuthClient interface. | 15 // A Chrome-specific implementation of the ProximityAuthClient interface. |
16 // There is one |ChromeProximityAuthClient| per |Profile|. | 16 // There is one |ChromeProximityAuthClient| per |Profile|. |
17 class ChromeProximityAuthClient : public proximity_auth::ProximityAuthClient { | 17 class ChromeProximityAuthClient : public proximity_auth::ProximityAuthClient { |
18 public: | 18 public: |
19 explicit ChromeProximityAuthClient(Profile* profile); | 19 explicit ChromeProximityAuthClient(Profile* profile); |
20 ~ChromeProximityAuthClient() override; | 20 ~ChromeProximityAuthClient() override; |
21 | 21 |
22 // proximity_auth::ProximityAuthClient: | 22 // proximity_auth::ProximityAuthClient: |
23 std::string GetAuthenticatedUsername() const override; | 23 std::string GetAuthenticatedUsername() const override; |
24 void UpdateScreenlockState(proximity_auth::ScreenlockState state) override; | 24 void UpdateScreenlockState(proximity_auth::ScreenlockState state) override; |
25 void FinalizeUnlock(bool success) override; | 25 void FinalizeUnlock(bool success) override; |
26 PrefService* GetPrefService() override; | 26 PrefService* GetPrefService() override; |
27 std::unique_ptr<proximity_auth::SecureMessageDelegate> | 27 std::unique_ptr<cryptauth::SecureMessageDelegate> |
28 CreateSecureMessageDelegate() override; | 28 CreateSecureMessageDelegate() override; |
29 std::unique_ptr<proximity_auth::CryptAuthClientFactory> | 29 std::unique_ptr<cryptauth::CryptAuthClientFactory> |
30 CreateCryptAuthClientFactory() override; | 30 CreateCryptAuthClientFactory() override; |
31 cryptauth::DeviceClassifier GetDeviceClassifier() override; | 31 cryptauth::DeviceClassifier GetDeviceClassifier() override; |
32 std::string GetAccountId() override; | 32 std::string GetAccountId() override; |
33 proximity_auth::CryptAuthEnrollmentManager* GetCryptAuthEnrollmentManager() | 33 cryptauth::CryptAuthEnrollmentManager* GetCryptAuthEnrollmentManager() |
34 override; | 34 override; |
35 proximity_auth::CryptAuthDeviceManager* GetCryptAuthDeviceManager() override; | 35 cryptauth::CryptAuthDeviceManager* GetCryptAuthDeviceManager() override; |
36 void FinalizeSignin(const std::string& secret) override; | 36 void FinalizeSignin(const std::string& secret) override; |
37 void GetChallengeForUserAndDevice( | 37 void GetChallengeForUserAndDevice( |
38 const std::string& user_id, | 38 const std::string& user_id, |
39 const std::string& remote_public_key, | 39 const std::string& remote_public_key, |
40 const std::string& nonce, | 40 const std::string& nonce, |
41 base::Callback<void(const std::string& challenge)> callback) override; | 41 base::Callback<void(const std::string& challenge)> callback) override; |
42 | 42 |
43 private: | 43 private: |
44 // Returns the EasyUnlockService instance used inside user sessions. | 44 // Returns the EasyUnlockService instance used inside user sessions. |
45 EasyUnlockServiceRegular* GetEasyUnlockServiceRegular(); | 45 EasyUnlockServiceRegular* GetEasyUnlockServiceRegular(); |
46 | 46 |
47 Profile* const profile_; | 47 Profile* const profile_; |
48 | 48 |
49 DISALLOW_COPY_AND_ASSIGN(ChromeProximityAuthClient); | 49 DISALLOW_COPY_AND_ASSIGN(ChromeProximityAuthClient); |
50 }; | 50 }; |
51 | 51 |
52 #endif // CHROME_BROWSER_SIGNIN_CHROME_PROXIMITY_AUTH_CLIENT_H_ | 52 #endif // CHROME_BROWSER_SIGNIN_CHROME_PROXIMITY_AUTH_CLIENT_H_ |
OLD | NEW |