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 8e2bf6d3a0b88530638569450cc221234124127b..27bf25846d2ba20e8e8f8ad055e45c35647754f9 100644 |
--- a/chrome/browser/ui/webui/sync_setup_handler.cc |
+++ b/chrome/browser/ui/webui/sync_setup_handler.cc |
@@ -1202,15 +1202,21 @@ void SyncSetupHandler::DidStopLoading( |
// since the user is doing something with it. Disconnect and forget about it |
// before closing down the sync setup. |
// The one exception is the expected continue URL. If the user lands there, |
- // this means sign in was successful. |
+ // this means sign in was successful. Ignore the source parameter in the |
+ // continue URL since this user may have changed the state of the |
+ // "Let me choose what to sync" checkbox. |
const GURL& url = active_gaia_signin_tab_->GetURL(); |
const GURL continue_url = |
SyncPromoUI::GetNextPageURLForSyncPromoURL( |
SyncPromoUI::GetSyncPromoURL(GURL(), |
SyncPromoUI::SOURCE_SETTINGS, |
false)); |
+ GURL::Replacements replacements; |
+ replacements.ClearQuery(); |
- if (url != continue_url && !gaia::IsGaiaSignonRealm(url.GetOrigin())) { |
+ if (!gaia::IsGaiaSignonRealm(url.GetOrigin()) && |
+ url.ReplaceComponents(replacements) != |
+ continue_url.ReplaceComponents(replacements)) { |
content::WebContentsObserver::Observe(NULL); |
active_gaia_signin_tab_ = NULL; |
CloseSyncSetup(); |