OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_FETCHER_H_ | 5 #ifndef CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_H_ |
6 #define CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_H_ | 6 #define CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 const char* const service); | 67 const char* const service); |
68 | 68 |
69 // Start a request to get a particular key from user info. | 69 // Start a request to get a particular key from user info. |
70 // GaiaAuthConsumer will be called back on the same thread when | 70 // GaiaAuthConsumer will be called back on the same thread when |
71 // results come back. | 71 // results come back. |
72 // You can't make more than one request at a time. | 72 // You can't make more than one request at a time. |
73 void StartGetUserInfo(const std::string& lsid, | 73 void StartGetUserInfo(const std::string& lsid, |
74 const std::string& info_key); | 74 const std::string& info_key); |
75 | 75 |
76 // Implementation of URLFetcher::Delegate | 76 // Implementation of URLFetcher::Delegate |
77 void OnURLFetchComplete(const URLFetcher* source, | 77 virtual void OnURLFetchComplete(const URLFetcher* source, |
78 const GURL& url, | 78 const GURL& url, |
79 const URLRequestStatus& status, | 79 const URLRequestStatus& status, |
80 int response_code, | 80 int response_code, |
81 const ResponseCookies& cookies, | 81 const ResponseCookies& cookies, |
82 const std::string& data); | 82 const std::string& data); |
83 | 83 |
84 // StartClientLogin been called && results not back yet? | 84 // StartClientLogin been called && results not back yet? |
85 bool HasPendingFetch(); | 85 bool HasPendingFetch(); |
86 | 86 |
87 // Stop any URL fetches in progress. | 87 // Stop any URL fetches in progress. |
88 void CancelRequest(); | 88 void CancelRequest(); |
89 | 89 |
90 private: | 90 private: |
91 // ClientLogin body constants that don't change | 91 // ClientLogin body constants that don't change |
92 static const char kCookiePersistence[]; | 92 static const char kCookiePersistence[]; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, IncomprehensibleError); | 197 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, IncomprehensibleError); |
198 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ServiceUnavailableError); | 198 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ServiceUnavailableError); |
199 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, CheckNormalErrorCode); | 199 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, CheckNormalErrorCode); |
200 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, CheckTwoFactorResponse); | 200 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, CheckTwoFactorResponse); |
201 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, LoginNetFailure); | 201 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, LoginNetFailure); |
202 | 202 |
203 DISALLOW_COPY_AND_ASSIGN(GaiaAuthFetcher); | 203 DISALLOW_COPY_AND_ASSIGN(GaiaAuthFetcher); |
204 }; | 204 }; |
205 | 205 |
206 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_H_ | 206 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_H_ |
OLD | NEW |