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

Unified Diff: chrome/common/net/gaia/gaia_auth_consumer.h

Issue 2834042: Add IssueAuthToken and unit tests to GaiaAuthenticator2. (Closed)
Patch Set: Created 10 years, 5 months 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
Index: chrome/common/net/gaia/gaia_auth_consumer.h
diff --git a/chrome/common/net/gaia/gaia_auth_consumer.h b/chrome/common/net/gaia/gaia_auth_consumer.h
index 31302c7ef6f22ac6a885f64bcb60646b26076441..b7b215cd8f1e7155836d3a6ccaa7e53deab0cf72 100644
--- a/chrome/common/net/gaia/gaia_auth_consumer.h
+++ b/chrome/common/net/gaia/gaia_auth_consumer.h
@@ -36,15 +36,15 @@ class GaiaAuthConsumer {
std::string data; // Full contents of ClientLogin return.
};
- enum ClientLoginErrorCode {
+ enum GaiaAuthErrorCode {
NETWORK_ERROR,
REQUEST_CANCELED,
TWO_FACTOR, // Callers can treat this as a success.
PERMISSION_DENIED
};
- struct ClientLoginError {
- inline bool operator==(const ClientLoginError &b) const {
+ struct GaiaAuthError {
+ inline bool operator==(const GaiaAuthError &b) const {
if (code != b.code) {
return false;
}
@@ -54,14 +54,20 @@ class GaiaAuthConsumer {
return true;
}
- ClientLoginErrorCode code;
+ GaiaAuthErrorCode code;
int network_error; // This field is only valid if NETWORK_ERROR occured.
std::string data; // TODO(chron): Remove this field. Should preparse data.
};
virtual ~GaiaAuthConsumer() {}
- virtual void OnClientLoginFailure(const ClientLoginError& error) = 0;
- virtual void OnClientLoginSuccess(const ClientLoginResult& result) = 0;
+
+ virtual void OnClientLoginSuccess(const ClientLoginResult& result) {}
+ virtual void OnClientLoginFailure(const GaiaAuthError& error) {}
+
+ virtual void OnIssueAuthTokenSuccess(const std::string& service,
+ const std::string& auth_token) {}
+ virtual void OnIssueAuthTokenFailure(const std::string& service,
+ const GaiaAuthError& error) {}
};
#endif // CHROME_COMMON_NET_GAIA_GAIA_AUTH_CONSUMER_H_

Powered by Google App Engine
This is Rietveld 408576698