Use kDefaultURL throughout SpdySessionTest.
[chromium-blink-merge.git] / components / proximity_auth / proximity_auth_client.h
blob3115cebba382d9df14f76ba7ad9c95c5d2bf8119
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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_CLIENT_H_
6 #define COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_CLIENT_H_
8 #include <string>
10 #include "base/memory/scoped_ptr.h"
11 #include "components/proximity_auth/cryptauth/proto/cryptauth_api.pb.h"
12 #include "components/proximity_auth/screenlock_state.h"
14 class PrefService;
16 namespace proximity_auth {
18 class CryptAuthClientFactory;
19 class CryptAuthDeviceManager;
20 class CryptAuthEnrollmentManager;
21 class SecureMessageDelegate;
23 // An interface that needs to be supplied to the Proximity Auth component by its
24 // embedder. There should be one |ProximityAuthClient| per
25 // |content::BrowserContext|.
26 class ProximityAuthClient {
27 public:
28 virtual ~ProximityAuthClient() {}
30 // Returns the authenticated username.
31 virtual std::string GetAuthenticatedUsername() const = 0;
33 // Updates the user pod on the signin or lock screen to reflect the provided
34 // screenlock state.
35 virtual void UpdateScreenlockState(ScreenlockState state) = 0;
37 // Finalizes an unlock attempt initiated by the user. If |success| is true,
38 // the screen is unlocked; otherwise, the auth attempt is rejected. An auth
39 // attempt must be in progress before calling this function.
40 virtual void FinalizeUnlock(bool success) = 0;
42 // Finalizes a sign-in attempt initiated by the user. If |success| is true,
43 // the user is signed in; otherwise, the auth attempt is rejected. An auth
44 // attempt must be in progress before calling this function.
45 virtual void FinalizeSignin(const std::string& secret) = 0;
47 // Returns the PrefService used by the profile.
48 virtual PrefService* GetPrefService() = 0;
50 // Returns the SecureMessageDelegate used by the system.
51 virtual scoped_ptr<SecureMessageDelegate> CreateSecureMessageDelegate() = 0;
53 // Constructs the CryptAuthClientFactory that can be used for API requests.
54 virtual scoped_ptr<CryptAuthClientFactory> CreateCryptAuthClientFactory() = 0;
56 // Constructs the DeviceClassifier message that is sent to CryptAuth for all
57 // API requests.
58 virtual cryptauth::DeviceClassifier GetDeviceClassifier() = 0;
60 // Returns the account id of the user.
61 virtual std::string GetAccountId() = 0;
63 virtual proximity_auth::CryptAuthEnrollmentManager*
64 GetCryptAuthEnrollmentManager() = 0;
66 virtual proximity_auth::CryptAuthDeviceManager*
67 GetCryptAuthDeviceManager() = 0;
70 } // namespace proximity_auth
72 #endif // COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_CLIENT_H_