| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 GOOGLE_APIS_GAIA_FAKE_GAIA_H_ | 5 #ifndef GOOGLE_APIS_GAIA_FAKE_GAIA_H_ |
| 6 #define GOOGLE_APIS_GAIA_FAKE_GAIA_H_ | 6 #define GOOGLE_APIS_GAIA_FAKE_GAIA_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class DictionaryValue; | 18 class Value; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace net { | 21 namespace net { |
| 22 namespace test_server { | 22 namespace test_server { |
| 23 class BasicHttpResponse; | 23 class BasicHttpResponse; |
| 24 struct HttpRequest; | 24 struct HttpRequest; |
| 25 class HttpResponse; | 25 class HttpResponse; |
| 26 } | 26 } |
| 27 } | 27 } |
| 28 | 28 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 164 |
| 165 std::string GetGaiaIdOfEmail(const std::string& email) const; | 165 std::string GetGaiaIdOfEmail(const std::string& email) const; |
| 166 | 166 |
| 167 void AddGoogleAccountsSigninHeader( | 167 void AddGoogleAccountsSigninHeader( |
| 168 net::test_server::BasicHttpResponse* http_response, | 168 net::test_server::BasicHttpResponse* http_response, |
| 169 const std::string& email) const; | 169 const std::string& email) const; |
| 170 | 170 |
| 171 void SetOAuthCodeCookie( | 171 void SetOAuthCodeCookie( |
| 172 net::test_server::BasicHttpResponse* http_response) const; | 172 net::test_server::BasicHttpResponse* http_response) const; |
| 173 | 173 |
| 174 // Formats a JSON response with the data in |response_dict|. | 174 // Formats a JSON response with the data in |value|. |
| 175 void FormatJSONResponse(const base::DictionaryValue& response_dict, | 175 void FormatJSONResponse(const base::Value& value, |
| 176 net::test_server::BasicHttpResponse* http_response); | 176 net::test_server::BasicHttpResponse* http_response); |
| 177 | 177 |
| 178 typedef base::Callback<void( | 178 typedef base::Callback<void( |
| 179 const net::test_server::HttpRequest& request, | 179 const net::test_server::HttpRequest& request, |
| 180 net::test_server::BasicHttpResponse* http_response)> | 180 net::test_server::BasicHttpResponse* http_response)> |
| 181 HttpRequestHandlerCallback; | 181 HttpRequestHandlerCallback; |
| 182 typedef std::map<std::string, HttpRequestHandlerCallback> RequestHandlerMap; | 182 typedef std::map<std::string, HttpRequestHandlerCallback> RequestHandlerMap; |
| 183 | 183 |
| 184 // HTTP request handlers. | 184 // HTTP request handlers. |
| 185 void HandleProgramaticAuth( | 185 void HandleProgramaticAuth( |
| (...skipping 29 matching lines...) Expand all Loading... |
| 215 void HandleListAccounts(const net::test_server::HttpRequest& request, | 215 void HandleListAccounts(const net::test_server::HttpRequest& request, |
| 216 net::test_server::BasicHttpResponse* http_response); | 216 net::test_server::BasicHttpResponse* http_response); |
| 217 void HandlePeopleGet(const net::test_server::HttpRequest& request, | 217 void HandlePeopleGet(const net::test_server::HttpRequest& request, |
| 218 net::test_server::BasicHttpResponse* http_response); | 218 net::test_server::BasicHttpResponse* http_response); |
| 219 void HandleGetUserInfo(const net::test_server::HttpRequest& request, | 219 void HandleGetUserInfo(const net::test_server::HttpRequest& request, |
| 220 net::test_server::BasicHttpResponse* http_response); | 220 net::test_server::BasicHttpResponse* http_response); |
| 221 void HandleOAuthUserInfo(const net::test_server::HttpRequest& request, | 221 void HandleOAuthUserInfo(const net::test_server::HttpRequest& request, |
| 222 net::test_server::BasicHttpResponse* http_response); | 222 net::test_server::BasicHttpResponse* http_response); |
| 223 void HandleSAMLRedirect(const net::test_server::HttpRequest& request, | 223 void HandleSAMLRedirect(const net::test_server::HttpRequest& request, |
| 224 net::test_server::BasicHttpResponse* http_response); | 224 net::test_server::BasicHttpResponse* http_response); |
| 225 void HandleGetCheckConnectionInfo( |
| 226 const net::test_server::HttpRequest& request, |
| 227 net::test_server::BasicHttpResponse* http_response); |
| 225 | 228 |
| 226 // Returns the access token associated with |auth_token| that matches the | 229 // Returns the access token associated with |auth_token| that matches the |
| 227 // given |client_id| and |scope_string|. If |scope_string| is empty, the first | 230 // given |client_id| and |scope_string|. If |scope_string| is empty, the first |
| 228 // token satisfying the other criteria is returned. Returns NULL if no token | 231 // token satisfying the other criteria is returned. Returns NULL if no token |
| 229 // matches. | 232 // matches. |
| 230 const AccessTokenInfo* FindAccessTokenInfo( | 233 const AccessTokenInfo* FindAccessTokenInfo( |
| 231 const std::string& auth_token, | 234 const std::string& auth_token, |
| 232 const std::string& client_id, | 235 const std::string& client_id, |
| 233 const std::string& scope_string) const; | 236 const std::string& scope_string) const; |
| 234 | 237 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 245 SamlAccountIdpMap saml_account_idp_map_; | 248 SamlAccountIdpMap saml_account_idp_map_; |
| 246 SamlDomainRedirectUrlMap saml_domain_url_map_; | 249 SamlDomainRedirectUrlMap saml_domain_url_map_; |
| 247 bool issue_oauth_code_cookie_; | 250 bool issue_oauth_code_cookie_; |
| 248 RefreshTokenToDeviceIdMap refresh_token_to_device_id_map_; | 251 RefreshTokenToDeviceIdMap refresh_token_to_device_id_map_; |
| 249 std::string prefilled_email_; | 252 std::string prefilled_email_; |
| 250 | 253 |
| 251 DISALLOW_COPY_AND_ASSIGN(FakeGaia); | 254 DISALLOW_COPY_AND_ASSIGN(FakeGaia); |
| 252 }; | 255 }; |
| 253 | 256 |
| 254 #endif // GOOGLE_APIS_GAIA_FAKE_GAIA_H_ | 257 #endif // GOOGLE_APIS_GAIA_FAKE_GAIA_H_ |
| OLD | NEW |