Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Unified Diff: chrome/browser/sync/engine/auth_watcher.cc

Issue 389017: Implement the gaia captcha state and unlock capability in the sync setup wiza... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/engine/auth_watcher.h ('k') | chrome/browser/sync/engine/syncapi.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/auth_watcher.cc
===================================================================
--- chrome/browser/sync/engine/auth_watcher.cc (revision 31575)
+++ chrome/browser/sync/engine/auth_watcher.cc (working copy)
@@ -217,11 +217,19 @@
SignIn const signin = user_settings_->
RecallSigninType(request.email, GMAIL_SIGNIN);
+ // We let the caller be lazy and try using the last captcha token seen by
+ // the gaia authenticator if they haven't provided a token but have sent
+ // a challenge response. Of course, if the captcha token is specified,
+ // we use that one instead.
+ std::string captcha_token(request.captcha_token);
+ if (!request.captcha_value.empty() && captcha_token.empty())
+ captcha_token = gaia_->captcha_token();
+
if (!request.password.empty()) {
bool authenticated = false;
- if (!request.captcha_token.empty() && !request.captcha_value.empty()) {
+ if (!captcha_token.empty()) {
authenticated = gaia_->Authenticate(request.email, request.password,
- save, request.captcha_token,
+ save, captcha_token,
request.captcha_value, signin);
} else {
authenticated = gaia_->Authenticate(request.email, request.password,
« no previous file with comments | « chrome/browser/sync/engine/auth_watcher.h ('k') | chrome/browser/sync/engine/syncapi.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698