OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // cookies set by the Gaia servers. | 61 // cookies set by the Gaia servers. |
62 class GaiaAuthenticator { | 62 class GaiaAuthenticator { |
63 FRIEND_TEST_ALL_PREFIXES(GaiaAuthenticatorTest, | 63 FRIEND_TEST_ALL_PREFIXES(GaiaAuthenticatorTest, |
64 TestNewlineAtEndOfAuthTokenRemoved); | 64 TestNewlineAtEndOfAuthTokenRemoved); |
65 public: | 65 public: |
66 | 66 |
67 // Since GaiaAuthenticator can be used for any service, or by any client, you | 67 // Since GaiaAuthenticator can be used for any service, or by any client, you |
68 // must include a user-agent and a service-id when creating one. The | 68 // must include a user-agent and a service-id when creating one. The |
69 // user_agent is a short string used for simple log analysis. gaia_url is used | 69 // user_agent is a short string used for simple log analysis. gaia_url is used |
70 // to choose the server to authenticate with (e.g. | 70 // to choose the server to authenticate with (e.g. |
71 // http://accounts.google.com/ClientLogin). | 71 // http://www.google.com/accounts/ClientLogin). |
72 GaiaAuthenticator(const std::string& user_agent, | 72 GaiaAuthenticator(const std::string& user_agent, |
73 const std::string& service_id, | 73 const std::string& service_id, |
74 const std::string& gaia_url); | 74 const std::string& gaia_url); |
75 | 75 |
76 virtual ~GaiaAuthenticator(); | 76 virtual ~GaiaAuthenticator(); |
77 | 77 |
78 // This object should only be invoked from the AuthWatcherThread message | 78 // This object should only be invoked from the AuthWatcherThread message |
79 // loop, which is injected here. | 79 // loop, which is injected here. |
80 void set_message_loop(const MessageLoop* loop) { | 80 void set_message_loop(const MessageLoop* loop) { |
81 message_loop_ = loop; | 81 message_loop_ = loop; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 time_t next_allowed_auth_attempt_time_; | 264 time_t next_allowed_auth_attempt_time_; |
265 #endif // defined(OS_WIN) | 265 #endif // defined(OS_WIN) |
266 int early_auth_attempt_count_; | 266 int early_auth_attempt_count_; |
267 | 267 |
268 // The message loop all our methods are invoked on. | 268 // The message loop all our methods are invoked on. |
269 const MessageLoop* message_loop_; | 269 const MessageLoop* message_loop_; |
270 }; | 270 }; |
271 | 271 |
272 } // namespace gaia | 272 } // namespace gaia |
273 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTHENTICATOR_H_ | 273 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTHENTICATOR_H_ |
OLD | NEW |