| 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 1fd4cff900313875753caa65836b50b26793f3f9..0778034ba501e0759fae94af9f5c21ae41401ebb 100644
|
| --- a/components/signin/core/browser/account_reconcilor.cc
|
| +++ b/components/signin/core/browser/account_reconcilor.cc
|
| @@ -359,10 +359,8 @@ void AccountReconcilor::GoogleSignedOut(const std::string& username) {
|
| }
|
|
|
| void AccountReconcilor::PerformMergeAction(const std::string& account_id) {
|
| - if (!switches::IsNewProfileManagement()) {
|
| - MarkAccountAsAddedToCookie(account_id);
|
| + if (!switches::IsNewProfileManagement())
|
| return;
|
| - }
|
| VLOG(1) << "AccountReconcilor::PerformMergeAction: " << account_id;
|
| merge_session_helper_.LogIn(account_id);
|
| }
|
| @@ -400,10 +398,8 @@ void AccountReconcilor::PerformFinishRemoveAction(
|
|
|
| void AccountReconcilor::PerformAddToChromeAction(const std::string& account_id,
|
| int session_index) {
|
| - if (!switches::IsNewProfileManagement()) {
|
| - MarkAccountAsAddedToChrome(account_id);
|
| + if (!switches::IsNewProfileManagement())
|
| return;
|
| - }
|
| VLOG(1) << "AccountReconcilor::PerformAddToChromeAction:"
|
| << " account=" << account_id << " session_index=" << session_index;
|
|
|
| @@ -710,9 +706,13 @@ void AccountReconcilor::ScheduleStartReconcileIfChromeAccountsChanged() {
|
| }
|
| }
|
|
|
| -// Remove the account from the list that is being merged.
|
| -void AccountReconcilor::MarkAccountAsAddedToCookie(
|
| - const std::string& account_id) {
|
| +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.
|
| for (std::vector<std::string>::iterator i = add_to_cookie_.begin();
|
| i != add_to_cookie_.end();
|
| ++i) {
|
| @@ -721,15 +721,7 @@ void AccountReconcilor::MarkAccountAsAddedToCookie(
|
| break;
|
| }
|
| }
|
| -}
|
| -
|
| -void AccountReconcilor::MergeSessionCompleted(
|
| - const std::string& account_id,
|
| - const GoogleServiceAuthError& error) {
|
| - VLOG(1) << "AccountReconcilor::MergeSessionCompleted: account_id="
|
| - << account_id;
|
|
|
| - MarkAccountAsAddedToCookie(account_id);
|
| CalculateIfReconcileIsDone();
|
| ScheduleStartReconcileIfChromeAccountsChanged();
|
| }
|
| @@ -756,9 +748,13 @@ void AccountReconcilor::PerformAddAccountToTokenService(
|
| token_service_->UpdateCredentials(account_id, refresh_token);
|
| }
|
|
|
| -// Remove the account from the list that is being updated.
|
| -void AccountReconcilor::MarkAccountAsAddedToChrome(
|
| - const std::string& account_id) {
|
| +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.
|
| for (std::vector<std::pair<std::string, int> >::iterator i =
|
| add_to_chrome_.begin();
|
| i != add_to_chrome_.end();
|
| @@ -768,14 +764,6 @@ void AccountReconcilor::MarkAccountAsAddedToChrome(
|
| break;
|
| }
|
| }
|
| -}
|
| -
|
| -void AccountReconcilor::HandleRefreshTokenFetched(
|
| - const std::string& account_id,
|
| - const std::string& refresh_token) {
|
| - if (!refresh_token.empty())
|
| - PerformAddAccountToTokenService(account_id, refresh_token);
|
|
|
| - MarkAccountAsAddedToChrome(account_id);
|
| CalculateIfReconcileIsDone();
|
| }
|
|
|