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

Unified Diff: chrome/browser/sync/engine/syncapi.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/syncapi.h ('k') | chrome/browser/sync/glue/sync_backend_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/syncapi.cc
===================================================================
--- chrome/browser/sync/engine/syncapi.cc (revision 31729)
+++ chrome/browser/sync/engine/syncapi.cc (working copy)
@@ -706,7 +706,8 @@
// the SyncManager::Observer. It may, in turn, decide to try again with new
// credentials. Calling this method again is the appropriate course of action
// to "retry".
- void Authenticate(const std::string& username, const std::string& password);
+ void Authenticate(const std::string& username, const std::string& password,
+ const std::string& captcha);
// Call periodically from a database-safe thread to persist recent changes
// to the syncapi model.
@@ -934,8 +935,10 @@
user_agent);
}
-void SyncManager::Authenticate(const char* username, const char* password) {
- data_->Authenticate(std::string(username), std::string(password));
+void SyncManager::Authenticate(const char* username, const char* password,
+ const char* captcha) {
+ data_->Authenticate(std::string(username), std::string(password),
+ std::string(captcha));
}
const std::string& SyncManager::GetAuthenticatedUsername() {
@@ -1058,7 +1061,8 @@
}
void SyncManager::SyncInternal::Authenticate(const std::string& username,
- const std::string& password) {
+ const std::string& password,
+ const std::string& captcha) {
DCHECK(username_for_share().empty() || username == username_for_share())
<< "Username change from valid username detected";
if (allstatus()->status().authenticated)
@@ -1070,7 +1074,8 @@
// our GoogleServiceAuthError state to denote an error.
RaiseAuthNeededEvent();
}
- auth_watcher()->Authenticate(username, password, true);
+ auth_watcher()->Authenticate(username, password, std::string(),
+ captcha, true);
}
void SyncManager::SyncInternal::AuthenticateForLastKnownUser() {
@@ -1435,11 +1440,9 @@
case AuthWatcherEvent::GAIA_AUTH_FAILED: // Invalid GAIA credentials.
if (event.auth_results->auth_error == browser_sync::CaptchaRequired) {
auth_problem_ = AuthError::CAPTCHA_REQUIRED;
- GURL captcha("http://www.google.com/accounts/");
- GURL::Replacements replacer;
- replacer.SetPathStr(captcha.path().append(
- event.auth_results->captcha_url));
- captcha = captcha.ReplaceComponents(replacer);
+ std::string url_string("http://www.google.com/accounts/");
+ url_string += event.auth_results->captcha_url;
+ GURL captcha(url_string);
observer_->OnAuthError(AuthError::FromCaptchaChallenge(
event.auth_results->captcha_token, captcha,
GURL(event.auth_results->auth_error_url)));
« no previous file with comments | « chrome/browser/sync/engine/syncapi.h ('k') | chrome/browser/sync/glue/sync_backend_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698