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 219a5e9d649e6280a084c84f59bfe0144eaa5b4b..1381109a03c5c4aff51bd98ac3132bd984c519cd 100644 |
--- a/chrome/browser/ui/webui/sync_setup_handler.cc |
+++ b/chrome/browser/ui/webui/sync_setup_handler.cc |
@@ -1168,7 +1168,6 @@ void SyncSetupHandler::CloseSyncSetup() { |
if (sync_service) { |
DVLOG(1) << "Sync setup aborted by user action"; |
sync_service->OnStopSyncingPermanently(); |
- sync_service->SetSetupInProgress(false); |
} |
} |
@@ -1181,6 +1180,12 @@ void SyncSetupHandler::CloseSyncSetup() { |
GetLoginUIService()->LoginUIClosed(this); |
} |
+ // Alert the sync service anytime the sync setup dialog is closed. This can |
+ // happen due to the user clicking the OK or Cancel button, or due to the |
+ // dialog being closed by virtue of sync being disabled in the background. |
+ if (sync_service) |
+ sync_service->SetSetupInProgress(false); |
+ |
#if !defined(OS_CHROMEOS) |
// Reset the attempted email address and error, otherwise the sync setup |
// overlay in the settings page will stay in whatever error state it was last |