Index: chrome/browser/ui/webui/sync_setup_handler.cc |
diff --git a/chrome/browser/ui/webui/sync_setup_handler.cc b/chrome/browser/ui/webui/sync_setup_handler.cc |
index 364c60949b020c5c176912364b2ebf1c9eb8356f..fd76e7afd5f3456eea3ed452aee250ce4541233a 100644 |
--- a/chrome/browser/ui/webui/sync_setup_handler.cc |
+++ b/chrome/browser/ui/webui/sync_setup_handler.cc |
@@ -844,7 +844,8 @@ void SyncSetupHandler::OpenSyncSetup() { |
// empty). |
// 3) Previously working credentials have expired. |
// 4) User is signed in, but has stopped sync via the google dashboard, and |
- // signout is prohibited by policy so we need to force a re-auth. |
+ // signout is prohibited by policy so we need to force a re-auth to update |
+ // ProfileSyncService's auth token. |
// 5) User clicks [Advanced Settings] button on options page while already |
// logged in. |
// 6) One-click signin (credentials are already available, so should display |
@@ -853,13 +854,15 @@ void SyncSetupHandler::OpenSyncSetup() { |
#if !defined(OS_CHROMEOS) |
SigninManagerBase* signin = |
SigninManagerFactory::GetForProfile(GetProfile()); |
- |
+ ProfileSyncService* service = GetSyncService(); |
if (signin->GetAuthenticatedUsername().empty() || |
- SigninGlobalError::GetForProfile(GetProfile())->HasMenuItem()) { |
+ SigninGlobalError::GetForProfile(GetProfile())->HasMenuItem() || |
+ (service && !service->IsOAuthRefreshTokenAvailable())) { |
Andrew T Wilson (Slow)
2013/08/21 08:30:46
I think this probably isn't the right way to do th
Raghu Simha
2013/08/22 00:05:12
Agreed. I've sent out a new CL with a different ap
|
// User is not logged in (cases 1-2), or login has been specially requested |
- // because previously working credentials have expired (case 3). Close sync |
- // setup including any visible overlays, and display the gaia auth page. |
- // Control will be returned to the sync settings page once auth is complete. |
+ // because previously working credentials have expired (case 3), or sync |
+ // no longer has a valid auth token (case 4). Close sync setup including any |
+ // visible overlays, and display the gaia auth page. Control will be |
+ // returned to the sync settings page once auth is complete. |
CloseSyncSetup(); |
DisplayGaiaLogin(); |
return; |
@@ -873,7 +876,7 @@ void SyncSetupHandler::OpenSyncSetup() { |
} |
// User is already logged in. They must have brought up the config wizard |
- // via the "Advanced..." button or through One-Click signin (cases 4-6), or |
+ // via the "Advanced..." button or through One-Click signin (cases 5-6), or |
// they are re-enabling sync after having disabled it (case 7). |
DisplayConfigureSync(true, false); |
} |