Chromium Code Reviews| Index: components/signin/core/browser/account_reconcilor.cc |
| diff --git a/components/signin/core/browser/account_reconcilor.cc b/components/signin/core/browser/account_reconcilor.cc |
| index 058bc3b3dc24c2d9be5f63d8efdec2aa26cce195..fceaaaaa65a21ff01ae00c3c293c5823a577fc3e 100644 |
| --- a/components/signin/core/browser/account_reconcilor.cc |
| +++ b/components/signin/core/browser/account_reconcilor.cc |
| @@ -359,8 +359,10 @@ void AccountReconcilor::GoogleSignedOut(const std::string& username) { |
| } |
| void AccountReconcilor::PerformMergeAction(const std::string& account_id) { |
| - if (!switches::IsNewProfileManagement()) |
| + if (!switches::IsNewProfileManagement()) { |
| + MarkAccountAsAddedToCookie(account_id); |
| return; |
| + } |
| VLOG(1) << "AccountReconcilor::PerformMergeAction: " << account_id; |
| merge_session_helper_.LogIn(account_id); |
| } |
| @@ -398,8 +400,10 @@ void AccountReconcilor::PerformFinishRemoveAction( |
| void AccountReconcilor::PerformAddToChromeAction(const std::string& account_id, |
| int session_index) { |
| - if (!switches::IsNewProfileManagement()) |
| + if (!switches::IsNewProfileManagement()) { |
| + MarkAccountAsAddedToChrome(account_id); |
| return; |
| + } |
| VLOG(1) << "AccountReconcilor::PerformAddToChromeAction:" |
| << " account=" << account_id << " session_index=" << session_index; |
| @@ -693,13 +697,9 @@ void AccountReconcilor::ScheduleStartReconcileIfChromeAccountsChanged() { |
| } |
| } |
| -void AccountReconcilor::MergeSessionCompleted( |
| - const std::string& account_id, |
| - const GoogleServiceAuthError& error) { |
| - VLOG(1) << "AccountReconcilor::MergeSessionCompleted: account_id=" |
| - << account_id; |
| - |
| - // Remove the account from the list that is being merged. |
| +// Remove the account from the list that is being merged. |
| +void AccountReconcilor::MarkAccountAsAddedToCookie( |
| + const std::string& account_id) { |
| for (std::vector<std::string>::iterator i = add_to_cookie_.begin(); |
| i != add_to_cookie_.end(); |
| ++i) { |
| @@ -708,7 +708,15 @@ void AccountReconcilor::MergeSessionCompleted( |
| break; |
| } |
| } |
| +} |
| +void AccountReconcilor::MergeSessionCompleted( |
| + const std::string& account_id, |
| + const GoogleServiceAuthError& error) { |
| + VLOG(1) << "AccountReconcilor::MergeSessionCompleted: account_id=" |
|
Alexei Svitkine (slow)
2014/06/12 17:09:14
Does this need to be VLOG(1)? The string will live
Mike Lerman
2014/06/12 18:12:16
We do use these in release builds to debug what's
|
| + << account_id; |
| + |
| + MarkAccountAsAddedToCookie(account_id); |
| CalculateIfReconcileIsDone(); |
| ScheduleStartReconcileIfChromeAccountsChanged(); |
| } |
| @@ -735,13 +743,9 @@ void AccountReconcilor::PerformAddAccountToTokenService( |
| token_service_->UpdateCredentials(account_id, refresh_token); |
| } |
| -void AccountReconcilor::HandleRefreshTokenFetched( |
| - const std::string& account_id, |
| - const std::string& refresh_token) { |
| - if (!refresh_token.empty()) { |
| - PerformAddAccountToTokenService(account_id, refresh_token); |
| - } |
| - // Remove the account from the list that is being updated. |
| +// Remove the account from the list that is being updated. |
| +void AccountReconcilor::MarkAccountAsAddedToChrome( |
| + const std::string& account_id) { |
| for (std::vector<std::pair<std::string, int> >::iterator i = |
| add_to_chrome_.begin(); |
| i != add_to_chrome_.end(); |
| @@ -751,6 +755,15 @@ void AccountReconcilor::HandleRefreshTokenFetched( |
| break; |
| } |
| } |
| +} |
| + |
| +void AccountReconcilor::HandleRefreshTokenFetched( |
| + const std::string& account_id, |
| + const std::string& refresh_token) { |
| + if (!refresh_token.empty()) { |
|
Alexei Svitkine (slow)
2014/06/12 17:09:14
Nit: No {}'s
Mike Lerman
2014/06/12 18:12:16
Done.
|
| + PerformAddAccountToTokenService(account_id, refresh_token); |
| + } |
| + MarkAccountAsAddedToChrome(account_id); |
| CalculateIfReconcileIsDone(); |
| } |