Commit 7f944734 authored by rsimha@chromium.org's avatar rsimha@chromium.org

[sync] Fix incorrectly grayed out "Disconnect your Google Account..." button

The "Disconnect your Google Account..." button in the settings page is
supposed to be grayed out when sync setup is in progress, as indicated
by ProfileSyncService::setup_in_progress_. Earlier, we were calling
ProfileSyncService::SetSetupInProgress(false) under all circumstances
from SyncSetupHandler::CloseSyncSetup(), but with r200867, we missed out
on setting the value to false under some conditions. One example of the
flag incorrectly remaining set to true occurs when the user enables
encryption with a custom passphrase and then clears sync data via the
dashboard.

This patch adds a call to ProfileSyncService::SetSetupInProgress(false)
from SyncSetupHandler::CloseSyncSetup() irrespective of why the settings
dialog was closed.

BUG=243078
TEST=Enable custom encryption, do a dashboard clear, and check the settings page

Review URL: https://chromiumcodereview.appspot.com/15742014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202006 0039d316-1c4b-4281-b951-d872f2087c98
parent a621ebd3
...@@ -1168,7 +1168,6 @@ void SyncSetupHandler::CloseSyncSetup() { ...@@ -1168,7 +1168,6 @@ void SyncSetupHandler::CloseSyncSetup() {
if (sync_service) { if (sync_service) {
DVLOG(1) << "Sync setup aborted by user action"; DVLOG(1) << "Sync setup aborted by user action";
sync_service->OnStopSyncingPermanently(); sync_service->OnStopSyncingPermanently();
sync_service->SetSetupInProgress(false);
} }
} }
...@@ -1181,6 +1180,12 @@ void SyncSetupHandler::CloseSyncSetup() { ...@@ -1181,6 +1180,12 @@ void SyncSetupHandler::CloseSyncSetup() {
GetLoginUIService()->LoginUIClosed(this); 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) #if !defined(OS_CHROMEOS)
// Reset the attempted email address and error, otherwise the sync setup // 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 // overlay in the settings page will stay in whatever error state it was last
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment