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.
5 #ifndef CHROME_BROWSER_NET_GAIA_GAIA_OAUTH_CONSUMER_H_
6 #define CHROME_BROWSER_NET_GAIA_GAIA_OAUTH_CONSUMER_H_
10 class GoogleServiceAuthError
;
12 // An interface that defines the callbacks for objects to which
13 // GaiaOAuthFetcher can return data.
14 class GaiaOAuthConsumer
{
16 virtual ~GaiaOAuthConsumer() {}
18 virtual void OnGetOAuthTokenSuccess(const std::string
& oauth_token
) {}
19 virtual void OnGetOAuthTokenFailure(const GoogleServiceAuthError
& error
) {}
21 virtual void OnOAuthGetAccessTokenSuccess(const std::string
& token
,
22 const std::string
& secret
) {}
23 virtual void OnOAuthGetAccessTokenFailure(
24 const GoogleServiceAuthError
& error
) {}
26 virtual void OnOAuthWrapBridgeSuccess(const std::string
& service_scope
,
27 const std::string
& token
,
28 const std::string
& expires_in
) {}
29 virtual void OnOAuthWrapBridgeFailure(const std::string
& service_scope
,
30 const GoogleServiceAuthError
& error
) {}
32 virtual void OnUserInfoSuccess(const std::string
& email
) {}
33 virtual void OnUserInfoFailure(const GoogleServiceAuthError
& error
) {}
35 virtual void OnOAuthLoginSuccess(const std::string
& sid
,
36 const std::string
& lsid
,
37 const std::string
& auth
) {}
38 virtual void OnOAuthLoginFailure(const GoogleServiceAuthError
& error
) {}
40 virtual void OnOAuthRevokeTokenSuccess() {}
41 virtual void OnOAuthRevokeTokenFailure(const GoogleServiceAuthError
& error
) {}
44 #endif // CHROME_BROWSER_NET_GAIA_GAIA_OAUTH_CONSUMER_H_