OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_COMMON_NET_GAIA_AUTHENTICATION_CONSUMER_H_ |
| 6 #define CHROME_COMMON_NET_GAIA_AUTHENTICATION_CONSUMER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <string> |
| 10 |
| 11 class GoogleServiceAuthError; |
| 12 |
| 13 // An interface that defines the callbacks for objects that |
| 14 // GaiaAuthFetcher can return data to. |
| 15 class AuthenticationConsumer { |
| 16 public: |
| 17 struct AuthenticationResult { |
| 18 public: |
| 19 ~AuthenticationResult(); |
| 20 |
| 21 virtual bool IsValid() const = 0; |
| 22 |
| 23 protected: |
| 24 AuthenticationResult(); |
| 25 |
| 26 private: |
| 27 bool operator==(const AuthenticationResult &b) const; |
| 28 }; |
| 29 |
| 30 virtual ~AuthenticationConsumer() {} |
| 31 |
| 32 virtual void OnAuthenticationSuccess(const AuthenticationResult& result) {} |
| 33 virtual void OnAuthenticationFailure(const GoogleServiceAuthError& error) {} |
| 34 |
| 35 virtual void OnIssueTokenSuccess(const std::string& service, |
| 36 const std::string& auth_token) {} |
| 37 virtual void OnIssueTokenFailure(const std::string& service, |
| 38 const GoogleServiceAuthError& error) {} |
| 39 |
| 40 virtual void OnGetUserInfoSuccess(const std::string& key, |
| 41 const std::string& value) {} |
| 42 virtual void OnGetUserInfoKeyNotFound(const std::string& key) {} |
| 43 virtual void OnGetUserInfoFailure(const GoogleServiceAuthError& error) {} |
| 44 }; |
| 45 |
| 46 #endif // CHROME_COMMON_NET_GAIA_AUTHENTICATION_CONSUMER_H_ |
OLD | NEW |