Chromium Code Reviews| Index: components/browser_sync/profile_sync_service.cc |
| diff --git a/components/browser_sync/profile_sync_service.cc b/components/browser_sync/profile_sync_service.cc |
| index 44c5cdd97e964fc588db245a1cd8e37f569709d2..221579bc3892005ef73bd82eca84795d69012d36 100644 |
| --- a/components/browser_sync/profile_sync_service.cc |
| +++ b/components/browser_sync/profile_sync_service.cc |
| @@ -37,6 +37,7 @@ |
| #include "components/signin/core/browser/profile_oauth2_token_service.h" |
| #include "components/signin/core/browser/signin_manager.h" |
| #include "components/signin/core/browser/signin_metrics.h" |
| +#include "components/signin/core/common/profile_management_switches.h" |
| #include "components/strings/grit/components_strings.h" |
| #include "components/sync/base/bind_to_task_runner.h" |
| #include "components/sync/base/cryptographer.h" |
| @@ -1961,6 +1962,14 @@ void ProfileSyncService::GoogleSigninSucceeded(const std::string& account_id, |
| // Track the fact that we're still waiting for auth to complete. |
| is_auth_in_progress_ = true; |
| } |
| + |
| + if (switches::IsAccountConsistencyDiceEnabled() && |
| + oauth2_token_service_->RefreshTokenIsAvailable(account_id)) { |
| + // When Dice is enabled, the refresh token may be available before the user |
| + // enables sync. Start sync if the refresh token is already available in the |
| + // token service when the authenticated account is set. |
| + OnRefreshTokenAvailable(account_id); |
|
Nicolas Zea
2017/06/28 19:43:24
Why isn't OnRefresTokenAvailable automatically bei
msarda2
2017/06/28 19:58:30
The problem is the order here: Take the following
|
| + } |
| } |
| void ProfileSyncService::GoogleSignedOut(const std::string& account_id, |