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_CLIENT_H_ | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_CLIENT_H_ |
6 #define COMPONENTS_PROXIMITY_AUTH_CLIENT_H_ | 6 #define COMPONENTS_PROXIMITY_AUTH_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
| 10 #include "components/proximity_auth/screenlock_state.h" |
| 11 |
10 namespace proximity_auth { | 12 namespace proximity_auth { |
11 | 13 |
12 // An interface that needs to be supplied to the Proximity Auth component by its | 14 // An interface that needs to be supplied to the Proximity Auth component by its |
13 // embedder. There should be one |ProximityAuthClient| per | 15 // embedder. There should be one |ProximityAuthClient| per |
14 // |content::BrowserContext|. | 16 // |content::BrowserContext|. |
15 class ProximityAuthClient { | 17 class ProximityAuthClient { |
16 public: | 18 public: |
17 virtual ~ProximityAuthClient() {} | 19 virtual ~ProximityAuthClient() {} |
18 | 20 |
19 // Returns the authenticated username. | 21 // Returns the authenticated username. |
20 virtual std::string GetAuthenticatedUsername() const = 0; | 22 virtual std::string GetAuthenticatedUsername() const = 0; |
21 | 23 |
| 24 // Updates the user pod on the signin or lock screen to reflect the provided |
| 25 // screenlock state. |
| 26 virtual void UpdateScreenlockState(ScreenlockState state) = 0; |
| 27 |
22 // Finalizes an unlock attempt initiated by the user. If |success| is true, | 28 // Finalizes an unlock attempt initiated by the user. If |success| is true, |
23 // the screen is unlocked; otherwise, the auth attempt is rejected. An auth | 29 // the screen is unlocked; otherwise, the auth attempt is rejected. An auth |
24 // attempt must be in progress before calling this function. | 30 // attempt must be in progress before calling this function. |
25 virtual void FinalizeUnlock(bool success) = 0; | 31 virtual void FinalizeUnlock(bool success) = 0; |
| 32 |
| 33 // Finalizes a sign-in attempt initiated by the user. If |success| is true, |
| 34 // the user is signed in; otherwise, the auth attempt is rejected. An auth |
| 35 // attempt must be in progress before calling this function. |
| 36 virtual void FinalizeSignin(const std::string& secret) = 0; |
26 }; | 37 }; |
27 | 38 |
28 } // namespace proximity_auth | 39 } // namespace proximity_auth |
29 | 40 |
30 #endif // COMPONENTS_PROXIMITY_AUTH_CLIENT_H_ | 41 #endif // COMPONENTS_PROXIMITY_AUTH_CLIENT_H_ |
OLD | NEW |