OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROMEOS_LOGIN_AUTH_STUB_AUTHENTICATOR_H_ | 5 #ifndef CHROMEOS_LOGIN_AUTH_STUB_AUTHENTICATOR_H_ |
6 #define CHROMEOS_LOGIN_AUTH_STUB_AUTHENTICATOR_H_ | 6 #define CHROMEOS_LOGIN_AUTH_STUB_AUTHENTICATOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
12 #include "chromeos/chromeos_export.h" | 12 #include "chromeos/chromeos_export.h" |
13 #include "chromeos/login/auth/authenticator.h" | 13 #include "chromeos/login/auth/authenticator.h" |
14 #include "chromeos/login/auth/user_context.h" | 14 #include "chromeos/login/auth/user_context.h" |
15 | 15 |
| 16 class AccountId; |
| 17 |
16 namespace content { | 18 namespace content { |
17 class BrowserContext; | 19 class BrowserContext; |
18 } | 20 } |
19 | 21 |
20 namespace chromeos { | 22 namespace chromeos { |
21 | 23 |
22 class AuthStatusConsumer; | 24 class AuthStatusConsumer; |
23 | 25 |
24 class CHROMEOS_EXPORT StubAuthenticator : public Authenticator { | 26 class CHROMEOS_EXPORT StubAuthenticator : public Authenticator { |
25 public: | 27 public: |
26 StubAuthenticator(AuthStatusConsumer* consumer, | 28 StubAuthenticator(AuthStatusConsumer* consumer, |
27 const UserContext& expected_user_context); | 29 const UserContext& expected_user_context); |
28 | 30 |
29 // Authenticator: | 31 // Authenticator: |
30 void CompleteLogin(content::BrowserContext* context, | 32 void CompleteLogin(content::BrowserContext* context, |
31 const UserContext& user_context) override; | 33 const UserContext& user_context) override; |
32 void AuthenticateToLogin(content::BrowserContext* context, | 34 void AuthenticateToLogin(content::BrowserContext* context, |
33 const UserContext& user_context) override; | 35 const UserContext& user_context) override; |
34 void AuthenticateToUnlock(const UserContext& user_context) override; | 36 void AuthenticateToUnlock(const UserContext& user_context) override; |
35 void LoginAsSupervisedUser(const UserContext& user_context) override; | 37 void LoginAsSupervisedUser(const UserContext& user_context) override; |
36 void LoginOffTheRecord() override; | 38 void LoginOffTheRecord() override; |
37 void LoginAsPublicSession(const UserContext& user_context) override; | 39 void LoginAsPublicSession(const UserContext& user_context) override; |
38 void LoginAsKioskAccount(const std::string& app_user_id, | 40 void LoginAsKioskAccount(const AccountId& app_account_id, |
39 bool use_guest_mount) override; | 41 bool use_guest_mount) override; |
40 void OnAuthSuccess() override; | 42 void OnAuthSuccess() override; |
41 void OnAuthFailure(const AuthFailure& failure) override; | 43 void OnAuthFailure(const AuthFailure& failure) override; |
42 void RecoverEncryptedData(const std::string& old_password) override; | 44 void RecoverEncryptedData(const std::string& old_password) override; |
43 void ResyncEncryptedData() override; | 45 void ResyncEncryptedData() override; |
44 | 46 |
45 virtual void SetExpectedCredentials(const UserContext& user_context); | 47 virtual void SetExpectedCredentials(const UserContext& user_context); |
46 | 48 |
47 protected: | 49 protected: |
48 ~StubAuthenticator() override; | 50 ~StubAuthenticator() override; |
49 | 51 |
50 private: | 52 private: |
51 UserContext expected_user_context_; | 53 UserContext expected_user_context_; |
52 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 54 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
53 | 55 |
54 DISALLOW_COPY_AND_ASSIGN(StubAuthenticator); | 56 DISALLOW_COPY_AND_ASSIGN(StubAuthenticator); |
55 }; | 57 }; |
56 | 58 |
57 } // namespace chromeos | 59 } // namespace chromeos |
58 | 60 |
59 #endif // CHROMEOS_LOGIN_AUTH_STUB_AUTHENTICATOR_H_ | 61 #endif // CHROMEOS_LOGIN_AUTH_STUB_AUTHENTICATOR_H_ |
OLD | NEW |