OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PARALLEL_AUTHENTICATOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // Given that some online auth operation has succeeded, determine which of | 199 // Given that some online auth operation has succeeded, determine which of |
200 // the possible success states we're in. | 200 // the possible success states we're in. |
201 // Must be called on the IO thread. | 201 // Must be called on the IO thread. |
202 AuthState ResolveOnlineSuccessState(AuthState offline_state); | 202 AuthState ResolveOnlineSuccessState(AuthState offline_state); |
203 | 203 |
204 // Used for testing. | 204 // Used for testing. |
205 void set_attempt_state(TestAttemptState* new_state) { // takes ownership. | 205 void set_attempt_state(TestAttemptState* new_state) { // takes ownership. |
206 current_state_.reset(new_state); | 206 current_state_.reset(new_state); |
207 } | 207 } |
208 | 208 |
| 209 // Sets an online attemp for testing. |
| 210 void set_online_attempt(OnlineAttempt* attempt) { |
| 211 current_online_ = attempt; |
| 212 } |
| 213 |
209 // Resets |current_state_| and then posts a task to the UI thread to | 214 // Resets |current_state_| and then posts a task to the UI thread to |
210 // Initiate() |to_initiate|. | 215 // Initiate() |to_initiate|. |
211 // Call this method on the IO thread. | 216 // Call this method on the IO thread. |
212 void ResyncRecoverHelper(CryptohomeOp* to_initiate); | 217 void ResyncRecoverHelper(CryptohomeOp* to_initiate); |
213 | 218 |
214 // If we don't have the system salt yet, loads it from the CryptohomeLibrary. | 219 // If we don't have the system salt yet, loads it from the CryptohomeLibrary. |
215 void LoadSystemSalt(); | 220 void LoadSystemSalt(); |
216 | 221 |
217 // If we haven't already, looks in a file called |filename| next to | 222 // If we haven't already, looks in a file called |filename| next to |
218 // the browser executable for a "localaccount" name, and retrieves it | 223 // the browser executable for a "localaccount" name, and retrieves it |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, ReadLocalaccount); | 298 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, ReadLocalaccount); |
294 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, | 299 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, |
295 ReadLocalaccountTrailingWS); | 300 ReadLocalaccountTrailingWS); |
296 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, ReadNoLocalaccount); | 301 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, ReadNoLocalaccount); |
297 DISALLOW_COPY_AND_ASSIGN(ParallelAuthenticator); | 302 DISALLOW_COPY_AND_ASSIGN(ParallelAuthenticator); |
298 }; | 303 }; |
299 | 304 |
300 } // namespace chromeos | 305 } // namespace chromeos |
301 | 306 |
302 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ | 307 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ |
OLD | NEW |