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 a1d87785102357cb699743a060214fbad96279a2..308b8b587800cd72973f0a91ee814e4c8f6c65c7 100644 |
--- a/chrome/browser/ui/webui/sync_setup_handler.cc |
+++ b/chrome/browser/ui/webui/sync_setup_handler.cc |
@@ -507,7 +507,7 @@ void SyncSetupHandler::DisplayConfigureSync(bool show_advanced, |
if (UseWebBasedSigninFlow()) { |
// Make sure the tab used for the Gaia sign in does not cover the settings |
// tab. |
- BringTabToFront(web_ui()->GetWebContents()); |
+ FocusUI(); |
} |
} |
@@ -838,16 +838,25 @@ void SyncSetupHandler::SigninFailed(const GoogleServiceAuthError& error) { |
backend_start_timer_.reset(); |
last_signin_error_ = error; |
- // Got a failed signin - this is either just a typical auth error, or a |
- // sync error (treat sync errors as "fatal errors" - i.e. non-auth errors). |
- // On ChromeOS, this condition can happen when auth token is invalid and |
- // cannot start sync backend. |
- if (retry_on_signin_failure_) { |
- DisplayGaiaLogin(GetSyncService()->HasUnrecoverableError()); |
+ |
+ // If using web-based sign in flow, don't show the gaia sign in page again |
+ // since there is no way to show the user an error message. |
+ if (UseWebBasedSigninFlow()) { |
+ CloseSyncSetup(); |
} else { |
- // TODO(peria): Show error dialog for prompting sign in and out on |
- // Chrome OS. http://crbug.com/128692 |
- CloseOverlay(); |
+ // Got a failed signin - this is either just a typical auth error, or a |
+ // sync error (treat sync errors as "fatal errors" - i.e. non-auth errors). |
+ // On ChromeOS, this condition can happen when auth token is invalid and |
+ // cannot start sync backend. |
+ // If using web-based sign in flow, don't show the gaia sign in page again |
+ // since there is no way to show the user an error message. |
+ if (retry_on_signin_failure_) { |
+ DisplayGaiaLogin(GetSyncService()->HasUnrecoverableError()); |
+ } else { |
+ // TODO(peria): Show error dialog for prompting sign in and out on |
+ // Chrome OS. http://crbug.com/128692 |
+ CloseOverlay(); |
+ } |
} |
} |
@@ -1124,7 +1133,7 @@ void SyncSetupHandler::OpenConfigureSync() { |
void SyncSetupHandler::FocusUI() { |
DCHECK(IsActiveLogin()); |
- // if |signin_tracker_| is valid and web-based sign flow is enabled, bring |
+ // if |signin_tracker_| is valid and web-based sign flow is enabled, bring |
// the tab containing the active gaia signing to the top. Otherwise activate |
// the settings tab. |
if (UseWebBasedSigninFlow() && signin_tracker_) { |