OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Use this class to authenticate users with Gaia and access cookies sent | 5 // Use this class to authenticate users with Gaia and access cookies sent |
6 // by the Gaia servers. This class lives on the SyncEngine_AuthWatcherThread. | 6 // by the Gaia servers. This class lives on the SyncEngine_AuthWatcherThread. |
7 // | 7 // |
8 // Sample usage: | 8 // Sample usage: |
9 // GaiaAuthenticator gaia_auth("User-Agent", SYNC_SERVICE_NAME, | 9 // GaiaAuthenticator gaia_auth("User-Agent", SYNC_SERVICE_NAME, |
10 // browser_sync::kExternalGaiaUrl); | 10 // browser_sync::kExternalGaiaUrl); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 std::string primary_email; | 146 std::string primary_email; |
147 | 147 |
148 // Fields for items returned when authentication fails. | 148 // Fields for items returned when authentication fails. |
149 std::string error_msg; | 149 std::string error_msg; |
150 enum AuthenticationError auth_error; | 150 enum AuthenticationError auth_error; |
151 std::string auth_error_url; | 151 std::string auth_error_url; |
152 std::string captcha_token; | 152 std::string captcha_token; |
153 std::string captcha_url; | 153 std::string captcha_url; |
154 SignIn signin; | 154 SignIn signin; |
155 | 155 |
156 AuthResults () : credentials_saved(DONT_SAVE_CREDENTIALS), | 156 AuthResults() : credentials_saved(DONT_SAVE_CREDENTIALS), |
157 auth_error(None) { } | 157 auth_error(None) { } |
158 }; | 158 }; |
159 | 159 |
160 protected: | 160 protected: |
161 | 161 |
162 struct AuthParams { | 162 struct AuthParams { |
163 GaiaAuthenticator* authenticator; | 163 GaiaAuthenticator* authenticator; |
164 uint32 request_id; | 164 uint32 request_id; |
165 SaveCredentials should_save_credentials; | 165 SaveCredentials should_save_credentials; |
166 std::string email; | 166 std::string email; |
167 std::string password; | 167 std::string password; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 int early_auth_attempt_count_; | 288 int early_auth_attempt_count_; |
289 | 289 |
290 // The message loop all our methods are invoked on. Generally this is the | 290 // The message loop all our methods are invoked on. Generally this is the |
291 // SyncEngine_AuthWatcherThread's message loop. | 291 // SyncEngine_AuthWatcherThread's message loop. |
292 const MessageLoop* message_loop_; | 292 const MessageLoop* message_loop_; |
293 }; | 293 }; |
294 | 294 |
295 } // namespace browser_sync | 295 } // namespace browser_sync |
296 | 296 |
297 #endif // CHROME_BROWSER_SYNC_ENGINE_NET_GAIA_AUTHENTICATOR_H_ | 297 #endif // CHROME_BROWSER_SYNC_ENGINE_NET_GAIA_AUTHENTICATOR_H_ |
OLD | NEW |