| Index: chrome/browser/ui/webui/settings/people_handler.cc
|
| diff --git a/chrome/browser/ui/webui/settings/people_handler.cc b/chrome/browser/ui/webui/settings/people_handler.cc
|
| index b86c221ec98838447933c29ca733b00dffd23c28..88429a8dcebba8f23df9516fbe4eac22edeb1b46 100644
|
| --- a/chrome/browser/ui/webui/settings/people_handler.cc
|
| +++ b/chrome/browser/ui/webui/settings/people_handler.cc
|
| @@ -662,6 +662,24 @@ void PeopleHandler::OpenSyncSetup() {
|
| return;
|
| }
|
|
|
| + if (!service->IsEngineInitialized()) {
|
| + // Requesting the sync service to start may trigger call to PushSyncPrefs.
|
| + // Setting up the startup tracker beforehand correctly signals the
|
| + // re-entrant call to early exit.
|
| + sync_startup_tracker_.reset(new SyncStartupTracker(profile_, this));
|
| + service->RequestStart();
|
| +
|
| + // See if it's even possible to bring up the sync engine - if not
|
| + // (unrecoverable error?), don't bother displaying a spinner that will be
|
| + // immediately closed because this leads to some ugly infinite UI loop (see
|
| + // http://crbug.com/244769).
|
| + if (SyncStartupTracker::GetSyncServiceState(profile_) !=
|
| + SyncStartupTracker::SYNC_STARTUP_ERROR) {
|
| + DisplaySpinner();
|
| + }
|
| + return;
|
| + }
|
| +
|
| // 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
|
| // they are re-enabling sync after having disabled it (case 7).
|
| @@ -776,24 +794,7 @@ void PeopleHandler::PushSyncPrefs() {
|
|
|
| ProfileSyncService* service = GetSyncService();
|
| // The sync service may be nullptr if it has been just disabled by policy.
|
| - if (!service)
|
| - return;
|
| -
|
| - if (!service->IsEngineInitialized()) {
|
| - // Requesting the sync service to start may trigger another reentrant call
|
| - // to PushSyncPrefs. Setting up the startup tracker beforehand correctly
|
| - // signals the re-entrant call to early exit.
|
| - sync_startup_tracker_.reset(new SyncStartupTracker(profile_, this));
|
| - service->RequestStart();
|
| -
|
| - // See if it's even possible to bring up the sync engine - if not
|
| - // (unrecoverable error?), don't bother displaying a spinner that will be
|
| - // immediately closed because this leads to some ugly infinite UI loop (see
|
| - // http://crbug.com/244769).
|
| - if (SyncStartupTracker::GetSyncServiceState(profile_) !=
|
| - SyncStartupTracker::SYNC_STARTUP_ERROR) {
|
| - DisplaySpinner();
|
| - }
|
| + if (!service || !service->IsEngineInitialized()) {
|
| return;
|
| }
|
|
|
|
|