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; |
| 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 |
| 28 // Finalizes the previously started auth attempt for unlock. Cancels the |
| 29 // current auth attempt if one exists. |
| 30 virtual void FinalizeUnlock(bool success) = 0; |
| 31 |
| 32 // Finalizes the previously started auth attempt for sign-in. Cancels the |
| 33 // current auth attempt if one exists. |
| 34 virtual void FinalizeSignin(const std::string& secret) = 0; |
21 }; | 35 }; |
22 | 36 |
23 } // namespace proximity_auth | 37 } // namespace proximity_auth |
24 | 38 |
25 #endif // COMPONENTS_PROXIMITY_AUTH_CLIENT_H_ | 39 #endif // COMPONENTS_PROXIMITY_AUTH_CLIENT_H_ |
OLD | NEW |