OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SIGNIN_FAKE_SIGNIN_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_ |
6 #define CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_ | 6 #define CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 #if !defined(OS_CHROMEOS) | 38 #if !defined(OS_CHROMEOS) |
39 | 39 |
40 // A signin manager that bypasses actual authentication routines with servers | 40 // A signin manager that bypasses actual authentication routines with servers |
41 // and accepts the credentials provided to StartSignIn. | 41 // and accepts the credentials provided to StartSignIn. |
42 class FakeSigninManager : public SigninManager { | 42 class FakeSigninManager : public SigninManager { |
43 public: | 43 public: |
44 explicit FakeSigninManager(Profile* profile); | 44 explicit FakeSigninManager(Profile* profile); |
45 ~FakeSigninManager() override; | 45 ~FakeSigninManager() override; |
46 | 46 |
47 void set_auth_in_progress(const std::string& username) { | 47 void set_auth_in_progress(const std::string& account_id) { |
48 possibly_invalid_username_ = username; | 48 possibly_invalid_account_id_ = account_id; |
49 } | 49 } |
50 | 50 |
51 void set_password(const std::string& password) { password_ = password; } | 51 void set_password(const std::string& password) { password_ = password; } |
52 | 52 |
53 void SignIn(const std::string& username, const std::string& password); | 53 void SignIn(const std::string& account_id, |
| 54 const std::string& username, |
| 55 const std::string& password); |
54 | 56 |
55 void FailSignin(const GoogleServiceAuthError& error); | 57 void FailSignin(const GoogleServiceAuthError& error); |
56 | 58 |
57 void StartSignInWithRefreshToken( | 59 void StartSignInWithRefreshToken( |
58 const std::string& refresh_token, | 60 const std::string& refresh_token, |
| 61 const std::string& gaia_id, |
59 const std::string& username, | 62 const std::string& username, |
60 const std::string& password, | 63 const std::string& password, |
61 const OAuthTokenFetchedCallback& oauth_fetched_callback) override; | 64 const OAuthTokenFetchedCallback& oauth_fetched_callback) override; |
62 | 65 |
63 void SignOut(signin_metrics::ProfileSignout signout_source_metric) override; | 66 void SignOut(signin_metrics::ProfileSignout signout_source_metric) override; |
64 | 67 |
65 void CompletePendingSignin() override; | 68 void CompletePendingSignin() override; |
| 69 |
| 70 // Username specified in StartSignInWithRefreshToken() call. |
| 71 std::string username_; |
66 }; | 72 }; |
67 | 73 |
68 #endif // !defined (OS_CHROMEOS) | 74 #endif // !defined (OS_CHROMEOS) |
69 | 75 |
70 #if defined(OS_CHROMEOS) | 76 #if defined(OS_CHROMEOS) |
71 typedef FakeSigninManagerBase FakeSigninManagerForTesting; | 77 typedef FakeSigninManagerBase FakeSigninManagerForTesting; |
72 #else | 78 #else |
73 typedef FakeSigninManager FakeSigninManagerForTesting; | 79 typedef FakeSigninManager FakeSigninManagerForTesting; |
74 #endif | 80 #endif |
75 | 81 |
76 #endif // CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_ | 82 #endif // CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_ |
OLD | NEW |