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
10class GoogleServiceAuthError;
11
12// An interface that defines the callbacks for objects to which
13// GaiaOAuthFetcher can return data.
14class GaiaOAuthConsumer {
15 public:
16  virtual ~GaiaOAuthConsumer() {}
17
18  virtual void OnGetOAuthTokenSuccess(const std::string& oauth_token) {}
19  virtual void OnGetOAuthTokenFailure(const GoogleServiceAuthError& error) {}
20
21  virtual void OnOAuthGetAccessTokenSuccess(const std::string& token,
22                                            const std::string& secret) {}
23  virtual void OnOAuthGetAccessTokenFailure(
24      const GoogleServiceAuthError& error) {}
25
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) {}
31
32  virtual void OnUserInfoSuccess(const std::string& email) {}
33  virtual void OnUserInfoFailure(const GoogleServiceAuthError& error) {}
34
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) {}
39
40  virtual void OnOAuthRevokeTokenSuccess() {}
41  virtual void OnOAuthRevokeTokenFailure(const GoogleServiceAuthError& error) {}
42};
43
44#endif  // CHROME_BROWSER_NET_GAIA_GAIA_OAUTH_CONSUMER_H_
45