• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_BROWSER_NET_GAIA_GAIA_OAUTH_CONSUMER_H_
6 #define CHROME_BROWSER_NET_GAIA_GAIA_OAUTH_CONSUMER_H_
7 
8 #include <string>
9 
10 class GoogleServiceAuthError;
11 
12 // An interface that defines the callbacks for objects to which
13 // GaiaOAuthFetcher can return data.
14 class GaiaOAuthConsumer {
15  public:
~GaiaOAuthConsumer()16   virtual ~GaiaOAuthConsumer() {}
17 
OnGetOAuthTokenSuccess(const std::string & oauth_token)18   virtual void OnGetOAuthTokenSuccess(const std::string& oauth_token) {}
OnGetOAuthTokenFailure(const GoogleServiceAuthError & error)19   virtual void OnGetOAuthTokenFailure(const GoogleServiceAuthError& error) {}
20 
OnOAuthGetAccessTokenSuccess(const std::string & token,const std::string & secret)21   virtual void OnOAuthGetAccessTokenSuccess(const std::string& token,
22                                             const std::string& secret) {}
OnOAuthGetAccessTokenFailure(const GoogleServiceAuthError & error)23   virtual void OnOAuthGetAccessTokenFailure(
24       const GoogleServiceAuthError& error) {}
25 
OnOAuthWrapBridgeSuccess(const std::string & service_scope,const std::string & token,const std::string & expires_in)26   virtual void OnOAuthWrapBridgeSuccess(const std::string& service_scope,
27                                         const std::string& token,
28                                         const std::string& expires_in) {}
OnOAuthWrapBridgeFailure(const std::string & service_scope,const GoogleServiceAuthError & error)29   virtual void OnOAuthWrapBridgeFailure(const std::string& service_scope,
30                                         const GoogleServiceAuthError& error) {}
31 
OnUserInfoSuccess(const std::string & email)32   virtual void OnUserInfoSuccess(const std::string& email) {}
OnUserInfoFailure(const GoogleServiceAuthError & error)33   virtual void OnUserInfoFailure(const GoogleServiceAuthError& error) {}
34 
OnOAuthLoginSuccess(const std::string & sid,const std::string & lsid,const std::string & auth)35   virtual void OnOAuthLoginSuccess(const std::string& sid,
36                                    const std::string& lsid,
37                                    const std::string& auth) {}
OnOAuthLoginFailure(const GoogleServiceAuthError & error)38   virtual void OnOAuthLoginFailure(const GoogleServiceAuthError& error) {}
39 
OnOAuthRevokeTokenSuccess()40   virtual void OnOAuthRevokeTokenSuccess() {}
OnOAuthRevokeTokenFailure(const GoogleServiceAuthError & error)41   virtual void OnOAuthRevokeTokenFailure(const GoogleServiceAuthError& error) {}
42 };
43 
44 #endif  // CHROME_BROWSER_NET_GAIA_GAIA_OAUTH_CONSUMER_H_
45