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

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

Issue 6894027: Initial refactoring complete Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixed some tests that were broken by previous refactoring Created 9 years, 8 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/authentication_consumer_oauth.h
diff --git a/chrome/common/net/gaia/authentication_consumer_oauth.h b/chrome/common/net/gaia/authentication_consumer_oauth.h
new file mode 100644
index 0000000000000000000000000000000000000000..caaab97300035070464c4d8b763850268ba41078
--- /dev/null
+++ b/chrome/common/net/gaia/authentication_consumer_oauth.h
@@ -0,0 +1,60 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_COMMON_NET_GAIA_AUTHENTICATION_CONSUMER_OAUTH_H_
+#define CHROME_COMMON_NET_GAIA_AUTHENTICATION_CONSUMER_OAUTH_H_
+#pragma once
+
+#include <string>
+
+#include "chrome/common/net/gaia/authentication_consumer.h"
+
+class GoogleServiceAuthError;
+
+// An interface that defines the callbacks for objects that
+// AuthenticationFetcherOAuth can return data to.
+class AuthenticationConsumerOAuth : public AuthenticationConsumer {
+ public:
+ struct AuthenticationResult
+ : public AuthenticationConsumer::AuthenticationResult {
+ AuthenticationResult();
+ AuthenticationResult(const std::string& new_sid,
+ const std::string& new_lsid,
+ const std::string& new_token,
+ const std::string& new_data);
+ ~AuthenticationResult();
+
+ bool operator==(const AuthenticationResult &b) const;
+
+ virtual bool IsValid() const;
+
+ std::string sid;
+ std::string lsid;
+ std::string token;
+ // TODO(chron): Remove the data field later. Don't use it if possible.
+ std::string data; // Full contents of ClientLogin return.
+ bool two_factor; // set to true if there was a TWO_FACTOR "failure".
+ };
+
+ virtual ~AuthenticationConsumerOAuth() {}
+
+ virtual void OnAuthenticationSuccess(const AuthenticationResult& result) {}
+ virtual void OnAuthenticationFailure(const GoogleServiceAuthError& error) {}
+
+ virtual void OnIssueAuthTokenSuccess(const std::string& service,
+ const std::string& auth_token) {}
+ virtual void OnIssueAuthTokenFailure(const std::string& service,
+ const GoogleServiceAuthError& error) {}
+
+
+ virtual void OnIssueTokenFailure(const std::string& service,
+ const GoogleServiceAuthError& error);
+
+ virtual void OnGetUserInfoSuccess(const std::string& key,
+ const std::string& value) {}
+ virtual void OnGetUserInfoKeyNotFound(const std::string& key) {}
+ virtual void OnGetUserInfoFailure(const GoogleServiceAuthError& error) {}
+};
+
+#endif // CHROME_COMMON_NET_GAIA_AUTHENTICATION_CONSUMER_OAUTH_H_
« no previous file with comments | « chrome/common/net/gaia/authentication_consumer.cc ('k') | chrome/common/net/gaia/authentication_consumer_oauth.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698