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 #include "components/signin/core/browser/fake_signin_manager.h" | 5 #include "components/signin/core/browser/fake_signin_manager.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "components/signin/core/browser/account_tracker_service.h" | 10 #include "components/signin/core/browser/account_tracker_service.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 const std::string& refresh_token, | 35 const std::string& refresh_token, |
36 const std::string& gaia_id, | 36 const std::string& gaia_id, |
37 const std::string& username, | 37 const std::string& username, |
38 const std::string& password, | 38 const std::string& password, |
39 const OAuthTokenFetchedCallback& oauth_fetched_callback) { | 39 const OAuthTokenFetchedCallback& oauth_fetched_callback) { |
40 set_auth_in_progress( | 40 set_auth_in_progress( |
41 account_tracker_service()->SeedAccountInfo(gaia_id, username)); | 41 account_tracker_service()->SeedAccountInfo(gaia_id, username)); |
42 set_password(password); | 42 set_password(password); |
43 username_ = username; | 43 username_ = username; |
44 | 44 |
| 45 possibly_invalid_gaia_id_.assign(gaia_id); |
| 46 possibly_invalid_email_.assign(username); |
| 47 |
45 if (!oauth_fetched_callback.is_null()) | 48 if (!oauth_fetched_callback.is_null()) |
46 oauth_fetched_callback.Run(refresh_token); | 49 oauth_fetched_callback.Run(refresh_token); |
47 } | 50 } |
48 | 51 |
49 void FakeSigninManager::CompletePendingSignin() { | 52 void FakeSigninManager::CompletePendingSignin() { |
50 SetAuthenticatedAccountId(GetAccountIdForAuthInProgress()); | 53 SetAuthenticatedAccountId(GetAccountIdForAuthInProgress()); |
51 set_auth_in_progress(std::string()); | 54 set_auth_in_progress(std::string()); |
52 FOR_EACH_OBSERVER( | 55 FOR_EACH_OBSERVER( |
53 SigninManagerBase::Observer, observer_list_, | 56 SigninManagerBase::Observer, observer_list_, |
54 GoogleSigninSucceeded(authenticated_account_id_, username_, password_)); | 57 GoogleSigninSucceeded(authenticated_account_id_, username_, password_)); |
(...skipping 27 matching lines...) Expand all Loading... |
82 set_password(std::string()); | 85 set_password(std::string()); |
83 const std::string account_id = GetAuthenticatedAccountId(); | 86 const std::string account_id = GetAuthenticatedAccountId(); |
84 const std::string username = GetAuthenticatedAccountInfo().email; | 87 const std::string username = GetAuthenticatedAccountInfo().email; |
85 authenticated_account_id_.clear(); | 88 authenticated_account_id_.clear(); |
86 | 89 |
87 FOR_EACH_OBSERVER(SigninManagerBase::Observer, observer_list_, | 90 FOR_EACH_OBSERVER(SigninManagerBase::Observer, observer_list_, |
88 GoogleSignedOut(account_id, username)); | 91 GoogleSignedOut(account_id, username)); |
89 } | 92 } |
90 | 93 |
91 #endif // !defined (OS_CHROMEOS) | 94 #endif // !defined (OS_CHROMEOS) |
OLD | NEW |