summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net/gaia
diff options
context:
space:
mode:
authorchron@chromium.org <chron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-19 18:44:19 +0000
committerchron@chromium.org <chron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-19 18:44:19 +0000
commit99074c5d22fac9f990aebe5055ea0bf68aef7ad7 (patch)
tree0ec4b33ed7b0758221befa68e1bba2c6fec0010f /chrome/browser/net/gaia
parent2313f55f13ee9f5d45f85a22f9e0459990aedc5a (diff)
downloadchromium_src-99074c5d22fac9f990aebe5055ea0bf68aef7ad7.zip
chromium_src-99074c5d22fac9f990aebe5055ea0bf68aef7ad7.tar.gz
chromium_src-99074c5d22fac9f990aebe5055ea0bf68aef7ad7.tar.bz2
Switch to GoogleServiceAuthError struct instead of GaiaAuthError.
Remove CAPTCHA code from existing user controller and plumb into google authenticator2. TEST=Install ChromeOS build. Hit Captcha. Enter captcha. BUG=50408 Review URL: http://codereview.chromium.org/3134009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56724 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net/gaia')
-rw-r--r--chrome/browser/net/gaia/token_service.cc4
-rw-r--r--chrome/browser/net/gaia/token_service.h14
-rw-r--r--chrome/browser/net/gaia/token_service_unittest.cc3
3 files changed, 11 insertions, 10 deletions
diff --git a/chrome/browser/net/gaia/token_service.cc b/chrome/browser/net/gaia/token_service.cc
index 103c102..b46868f 100644
--- a/chrome/browser/net/gaia/token_service.cc
+++ b/chrome/browser/net/gaia/token_service.cc
@@ -138,7 +138,7 @@ void TokenService::FireTokenAvailableNotification(
void TokenService::FireTokenRequestFailedNotification(
const std::string& service,
- const GaiaAuthError& error) {
+ const GoogleServiceAuthError& error) {
TokenRequestFailedDetails details(service, error);
NotificationService::current()->Notify(
@@ -157,7 +157,7 @@ void TokenService::OnIssueAuthTokenSuccess(const std::string& service,
}
void TokenService::OnIssueAuthTokenFailure(const std::string& service,
- const GaiaAuthError& error) {
+ const GoogleServiceAuthError& error) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
LOG(WARNING) << "Auth token issuing failed for service:" << service;
FireTokenRequestFailedNotification(service, error);
diff --git a/chrome/browser/net/gaia/token_service.h b/chrome/browser/net/gaia/token_service.h
index f182e6a..20ca12d 100644
--- a/chrome/browser/net/gaia/token_service.h
+++ b/chrome/browser/net/gaia/token_service.h
@@ -41,6 +41,7 @@
#include "chrome/browser/webdata/web_data_service.h"
#include "chrome/common/net/gaia/gaia_auth_consumer.h"
#include "chrome/common/net/gaia/gaia_authenticator2.h"
+#include "chrome/common/net/gaia/google_service_auth_error.h"
#include "base/gtest_prod_util.h"
class URLRequestContextGetter;
@@ -70,15 +71,16 @@ class TokenService : public GaiaAuthConsumer,
class TokenRequestFailedDetails {
public:
- TokenRequestFailedDetails() {}
+ TokenRequestFailedDetails()
+ : error_(GoogleServiceAuthError::NONE) {}
TokenRequestFailedDetails(const std::string& service,
- const GaiaAuthError& error)
+ const GoogleServiceAuthError& error)
: service_(service), error_(error) {}
const std::string& service() const { return service_; }
- const GaiaAuthError& error() const { return error_; }
+ const GoogleServiceAuthError& error() const { return error_; }
private:
std::string service_;
- GaiaAuthError error_;
+ GoogleServiceAuthError error_;
};
// Initialize this token service with a request source
@@ -125,7 +127,7 @@ class TokenService : public GaiaAuthConsumer,
virtual void OnIssueAuthTokenSuccess(const std::string& service,
const std::string& auth_token);
virtual void OnIssueAuthTokenFailure(const std::string& service,
- const GaiaAuthError& error);
+ const GoogleServiceAuthError& error);
// WebDataServiceConsumer implementation.
virtual void OnWebDataServiceRequestDone(WebDataService::Handle h,
@@ -137,7 +139,7 @@ class TokenService : public GaiaAuthConsumer,
const std::string& auth_token);
void FireTokenRequestFailedNotification(const std::string& service,
- const GaiaAuthError& error);
+ const GoogleServiceAuthError& error);
void LoadTokensIntoMemory(const std::map<std::string, std::string>& in_toks,
std::map<std::string, std::string>* out_toks);
diff --git a/chrome/browser/net/gaia/token_service_unittest.cc b/chrome/browser/net/gaia/token_service_unittest.cc
index 1082121..c560b61 100644
--- a/chrome/browser/net/gaia/token_service_unittest.cc
+++ b/chrome/browser/net/gaia/token_service_unittest.cc
@@ -159,8 +159,7 @@ TEST_F(TokenServiceTest, NotificationSuccess) {
TEST_F(TokenServiceTest, NotificationFailed) {
EXPECT_EQ(0U, success_tracker_.size());
EXPECT_EQ(0U, failure_tracker_.size());
- GaiaAuthConsumer::GaiaAuthError error;
- error.code = GaiaAuthConsumer::REQUEST_CANCELED;
+ GoogleServiceAuthError error(GoogleServiceAuthError::REQUEST_CANCELED);
service_.OnIssueAuthTokenFailure(GaiaConstants::kSyncService, error);
EXPECT_EQ(0U, success_tracker_.size());
EXPECT_EQ(1U, failure_tracker_.size());