| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_COMMON_NET_GAIA_GAIA_AUTH_CONSUMER_H_ | 5 #ifndef CHROME_COMMON_NET_GAIA_GAIA_AUTH_CONSUMER_H_ |
| 6 #define CHROME_COMMON_NET_GAIA_GAIA_AUTH_CONSUMER_H_ | 6 #define CHROME_COMMON_NET_GAIA_GAIA_AUTH_CONSUMER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <map> | 10 #include <map> |
| 11 #include <vector> |
| 11 | 12 |
| 12 class GoogleServiceAuthError; | 13 class GoogleServiceAuthError; |
| 13 | 14 |
| 15 namespace net { |
| 16 typedef std::vector<std::string> ResponseCookies; |
| 17 } |
| 18 |
| 14 typedef std::map<std::string, std::string> UserInfoMap; | 19 typedef std::map<std::string, std::string> UserInfoMap; |
| 15 | 20 |
| 16 // An interface that defines the callbacks for objects that | 21 // An interface that defines the callbacks for objects that |
| 17 // GaiaAuthFetcher can return data to. | 22 // GaiaAuthFetcher can return data to. |
| 18 class GaiaAuthConsumer { | 23 class GaiaAuthConsumer { |
| 19 public: | 24 public: |
| 20 struct ClientLoginResult { | 25 struct ClientLoginResult { |
| 21 ClientLoginResult(); | 26 ClientLoginResult(); |
| 22 ClientLoginResult(const std::string& new_sid, | 27 ClientLoginResult(const std::string& new_sid, |
| 23 const std::string& new_lsid, | 28 const std::string& new_lsid, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 46 const GoogleServiceAuthError& error) {} | 51 const GoogleServiceAuthError& error) {} |
| 47 | 52 |
| 48 virtual void OnOAuthLoginTokenSuccess(const std::string& refresh_token, | 53 virtual void OnOAuthLoginTokenSuccess(const std::string& refresh_token, |
| 49 const std::string& access_token, | 54 const std::string& access_token, |
| 50 int expires_in_secs) {} | 55 int expires_in_secs) {} |
| 51 virtual void OnOAuthLoginTokenFailure(const GoogleServiceAuthError& error) {} | 56 virtual void OnOAuthLoginTokenFailure(const GoogleServiceAuthError& error) {} |
| 52 | 57 |
| 53 virtual void OnGetUserInfoSuccess(const UserInfoMap& data) {} | 58 virtual void OnGetUserInfoSuccess(const UserInfoMap& data) {} |
| 54 virtual void OnGetUserInfoFailure(const GoogleServiceAuthError& error) {} | 59 virtual void OnGetUserInfoFailure(const GoogleServiceAuthError& error) {} |
| 55 | 60 |
| 56 virtual void OnTokenAuthSuccess(const std::string& data) {} | 61 virtual void OnTokenAuthSuccess(const net::ResponseCookies& cookies, |
| 62 const std::string& data) {} |
| 57 virtual void OnTokenAuthFailure(const GoogleServiceAuthError& error) {} | 63 virtual void OnTokenAuthFailure(const GoogleServiceAuthError& error) {} |
| 58 | 64 |
| 59 virtual void OnUberAuthTokenSuccess(const std::string& token) {} | 65 virtual void OnUberAuthTokenSuccess(const std::string& token) {} |
| 60 virtual void OnUberAuthTokenFailure(const GoogleServiceAuthError& error) {} | 66 virtual void OnUberAuthTokenFailure(const GoogleServiceAuthError& error) {} |
| 61 | 67 |
| 62 virtual void OnMergeSessionSuccess(const std::string& data) {} | 68 virtual void OnMergeSessionSuccess(const std::string& data) {} |
| 63 virtual void OnMergeSessionFailure(const GoogleServiceAuthError& error) {} | 69 virtual void OnMergeSessionFailure(const GoogleServiceAuthError& error) {} |
| 64 }; | 70 }; |
| 65 | 71 |
| 66 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTH_CONSUMER_H_ | 72 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTH_CONSUMER_H_ |
| OLD | NEW |