| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_NET_GAIA_GAIA_OAUTH_CONSUMER_H_ | 5 #ifndef CHROME_BROWSER_NET_GAIA_GAIA_OAUTH_CONSUMER_H_ |
| 6 #define CHROME_BROWSER_NET_GAIA_GAIA_OAUTH_CONSUMER_H_ | 6 #define CHROME_BROWSER_NET_GAIA_GAIA_OAUTH_CONSUMER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 class GoogleServiceAuthError; | 11 class GoogleServiceAuthError; |
| 12 | 12 |
| 13 // An interface that defines the callbacks for objects to which | 13 // An interface that defines the callbacks for objects to which |
| 14 // GaiaOAuthFetcher can return data. | 14 // GaiaOAuthFetcher can return data. |
| 15 class GaiaOAuthConsumer { | 15 class GaiaOAuthConsumer { |
| 16 public: | 16 public: |
| 17 virtual ~GaiaOAuthConsumer() {} | 17 virtual ~GaiaOAuthConsumer() {} |
| 18 | 18 |
| 19 virtual void OnGetOAuthTokenSuccess(const std::string& oauth_token) {} | 19 virtual void OnGetOAuthTokenSuccess(const std::string& oauth_token) {} |
| 20 virtual void OnGetOAuthTokenFailure() {} | 20 virtual void OnGetOAuthTokenFailure() {} |
| 21 | 21 |
| 22 virtual void OnOAuthGetAccessTokenSuccess(const std::string& token, | 22 virtual void OnOAuthGetAccessTokenSuccess(const std::string& token, |
| 23 const std::string& secret) {} | 23 const std::string& secret) {} |
| 24 virtual void OnOAuthGetAccessTokenFailure( | 24 virtual void OnOAuthGetAccessTokenFailure( |
| 25 const GoogleServiceAuthError& error) {} | 25 const GoogleServiceAuthError& error) {} |
| 26 | 26 |
| 27 virtual void OnOAuthWrapBridgeSuccess(const std::string& service_name, | 27 virtual void OnOAuthWrapBridgeSuccess(const std::string& service_scope, |
| 28 const std::string& token, | 28 const std::string& token, |
| 29 const std::string& expires_in) {} | 29 const std::string& expires_in) {} |
| 30 virtual void OnOAuthWrapBridgeFailure(const GoogleServiceAuthError& error) {} | 30 virtual void OnOAuthWrapBridgeFailure(const std::string& service_scope, |
| 31 const GoogleServiceAuthError& error) {} |
| 31 | 32 |
| 32 virtual void OnUserInfoSuccess(const std::string& email) {} | 33 virtual void OnUserInfoSuccess(const std::string& email) {} |
| 33 virtual void OnUserInfoFailure(const GoogleServiceAuthError& error) {} | 34 virtual void OnUserInfoFailure(const GoogleServiceAuthError& error) {} |
| 34 | 35 |
| 35 virtual void OnOAuthLoginSuccess(const std::string& sid, | 36 virtual void OnOAuthLoginSuccess(const std::string& sid, |
| 36 const std::string& lsid, | 37 const std::string& lsid, |
| 37 const std::string& auth) {} | 38 const std::string& auth) {} |
| 38 virtual void OnOAuthLoginFailure(const GoogleServiceAuthError& error) {} | 39 virtual void OnOAuthLoginFailure(const GoogleServiceAuthError& error) {} |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 #endif // CHROME_BROWSER_NET_GAIA_GAIA_OAUTH_CONSUMER_H_ | 42 #endif // CHROME_BROWSER_NET_GAIA_GAIA_OAUTH_CONSUMER_H_ |
| OLD | NEW |