OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_CHROMEOS_LOGIN_GOOGLE_AUTHENTICATOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_GOOGLE_AUTHENTICATOR_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_GOOGLE_AUTHENTICATOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_GOOGLE_AUTHENTICATOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 const std::string& login_token, | 58 const std::string& login_token, |
59 const std::string& login_captcha); | 59 const std::string& login_captcha); |
60 | 60 |
61 // Given a |username| and |password|, this method attempts to | 61 // Given a |username| and |password|, this method attempts to |
62 // authenticate to the cached credentials. This will never contact | 62 // authenticate to the cached credentials. This will never contact |
63 // the server even if it's online. The auth result is sent to | 63 // the server even if it's online. The auth result is sent to |
64 // LoginStatusConsumer in a same way as AuthenticateToLogin does. | 64 // LoginStatusConsumer in a same way as AuthenticateToLogin does. |
65 bool AuthenticateToUnlock(const std::string& username, | 65 bool AuthenticateToUnlock(const std::string& username, |
66 const std::string& password); | 66 const std::string& password); |
67 | 67 |
68 // Initiates off the record ("browse without signing in") login. | 68 // Initiates incognito ("browse without signing in") login. |
69 // Mounts tmpfs and notifies consumer on the success/failure. | 69 // Mounts tmpfs and notifies consumer on the success/failure. |
70 void LoginOffTheRecord(); | 70 void LoginOffTheRecord(); |
71 | 71 |
72 // Public for testing. | 72 // Public for testing. |
73 void set_system_salt(const chromeos::CryptohomeBlob& new_salt) { | 73 void set_system_salt(const chromeos::CryptohomeBlob& new_salt) { |
74 system_salt_ = new_salt; | 74 system_salt_ = new_salt; |
75 } | 75 } |
76 void set_username(const std::string& fake_user) { username_ = fake_user; } | 76 void set_username(const std::string& fake_user) { username_ = fake_user; } |
77 void set_password(const std::string& fake_pass) { password_ = fake_pass; } | 77 void set_password(const std::string& fake_pass) { password_ = fake_pass; } |
78 void set_password_hash(const std::string& fake_hash) { | 78 void set_password_hash(const std::string& fake_hash) { |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, LoginNetFailure); | 228 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, LoginNetFailure); |
229 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, LoginDenied); | 229 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, LoginDenied); |
230 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, TwoFactorLogin); | 230 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, TwoFactorLogin); |
231 | 231 |
232 DISALLOW_COPY_AND_ASSIGN(GoogleAuthenticator); | 232 DISALLOW_COPY_AND_ASSIGN(GoogleAuthenticator); |
233 }; | 233 }; |
234 | 234 |
235 } // namespace chromeos | 235 } // namespace chromeos |
236 | 236 |
237 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_GOOGLE_AUTHENTICATOR_H_ | 237 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_GOOGLE_AUTHENTICATOR_H_ |
OLD | NEW |