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 cannot be used on its own becaue it relies | 6 // by the Gaia servers. This class cannot be used on its own becaue it relies |
7 // on a subclass to provide the virtual Post and GetBackoffDelaySeconds methods. | 7 // on a subclass to provide the virtual Post and GetBackoffDelaySeconds methods. |
8 // | 8 // |
9 // Sample usage: | 9 // Sample usage: |
10 // class ActualGaiaAuthenticator : public gaia::GaiaAuthenticator { | 10 // class ActualGaiaAuthenticator : public gaia::GaiaAuthenticator { |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 inline std::string captcha_url() const { | 243 inline std::string captcha_url() const { |
244 DCHECK_EQ(MessageLoop::current(), message_loop_); | 244 DCHECK_EQ(MessageLoop::current(), message_loop_); |
245 return auth_results_.captcha_url; | 245 return auth_results_.captcha_url; |
246 } | 246 } |
247 | 247 |
248 inline AuthResults results() const { | 248 inline AuthResults results() const { |
249 DCHECK_EQ(MessageLoop::current(), message_loop_); | 249 DCHECK_EQ(MessageLoop::current(), message_loop_); |
250 return auth_results_; | 250 return auth_results_; |
251 } | 251 } |
252 | 252 |
253 typedef EventChannel<GaiaAuthEvent, Lock> Channel; | 253 typedef EventChannel<GaiaAuthEvent, base::Lock> Channel; |
254 | 254 |
255 inline Channel* channel() const { | 255 inline Channel* channel() const { |
256 return channel_; | 256 return channel_; |
257 } | 257 } |
258 | 258 |
259 private: | 259 private: |
260 bool IssueAuthToken(AuthResults* results, const std::string& service_id); | 260 bool IssueAuthToken(AuthResults* results, const std::string& service_id); |
261 | 261 |
262 // Helper method to parse response when authentication succeeds. | 262 // Helper method to parse response when authentication succeeds. |
263 void ExtractTokensFrom(const std::string& response, AuthResults* results); | 263 void ExtractTokensFrom(const std::string& response, AuthResults* results); |
(...skipping 30 matching lines...) Expand all Loading... |
294 #endif // defined(OS_WIN) | 294 #endif // defined(OS_WIN) |
295 int early_auth_attempt_count_; | 295 int early_auth_attempt_count_; |
296 | 296 |
297 // The message loop all our methods are invoked on. | 297 // The message loop all our methods are invoked on. |
298 const MessageLoop* message_loop_; | 298 const MessageLoop* message_loop_; |
299 }; | 299 }; |
300 | 300 |
301 } // namespace gaia | 301 } // namespace gaia |
302 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTHENTICATOR_H_ | 302 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTHENTICATOR_H_ |
303 | 303 |
OLD | NEW |