| 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 #ifndef CHROME_COMMON_NET_NOTIFIER_COMMUNICATOR_LOGIN_H_ | 5 #ifndef CHROME_COMMON_NET_NOTIFIER_COMMUNICATOR_LOGIN_H_ |
| 6 #define CHROME_COMMON_NET_NOTIFIER_COMMUNICATOR_LOGIN_H_ | 6 #define CHROME_COMMON_NET_NOTIFIER_COMMUNICATOR_LOGIN_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 class XmppClientSettings; | 24 class XmppClientSettings; |
| 25 } // namespace buzz | 25 } // namespace buzz |
| 26 | 26 |
| 27 namespace net { | 27 namespace net { |
| 28 class HostResolver; | 28 class HostResolver; |
| 29 } // namespace net | 29 } // namespace net |
| 30 | 30 |
| 31 namespace talk_base { | 31 namespace talk_base { |
| 32 class FirewallManager; | 32 class FirewallManager; |
| 33 struct ProxyInfo; | 33 struct ProxyInfo; |
| 34 class Task; | 34 class TaskParent; |
| 35 } // namespace talk_base | 35 } // namespace talk_base |
| 36 | 36 |
| 37 namespace notifier { | 37 namespace notifier { |
| 38 | 38 |
| 39 class ConnectionOptions; | 39 class ConnectionOptions; |
| 40 class LoginFailure; | 40 class LoginFailure; |
| 41 class LoginSettings; | 41 class LoginSettings; |
| 42 struct ServerInformation; | 42 struct ServerInformation; |
| 43 class SingleLoginAttempt; | 43 class SingleLoginAttempt; |
| 44 | 44 |
| 45 // Does the login, keeps it alive (with refreshing cookies and reattempting | 45 // Does the login, keeps it alive (with refreshing cookies and reattempting |
| 46 // login when disconnected), figures out what actions to take on the various | 46 // login when disconnected), figures out what actions to take on the various |
| 47 // errors that may occur. | 47 // errors that may occur. |
| 48 class Login : public net::NetworkChangeNotifier::Observer, | 48 class Login : public net::NetworkChangeNotifier::Observer, |
| 49 public sigslot::has_slots<> { | 49 public sigslot::has_slots<> { |
| 50 public: | 50 public: |
| 51 // network_status and firewall may be NULL. | 51 // network_status and firewall may be NULL. |
| 52 Login(talk_base::Task* parent, | 52 Login(talk_base::TaskParent* parent, |
| 53 const buzz::XmppClientSettings& user_settings, | 53 const buzz::XmppClientSettings& user_settings, |
| 54 const ConnectionOptions& options, | 54 const ConnectionOptions& options, |
| 55 std::string lang, | 55 std::string lang, |
| 56 net::HostResolver* host_resolver, | 56 net::HostResolver* host_resolver, |
| 57 ServerInformation* server_list, | 57 ServerInformation* server_list, |
| 58 int server_count, | 58 int server_count, |
| 59 net::NetworkChangeNotifier* network_change_notifier, | 59 net::NetworkChangeNotifier* network_change_notifier, |
| 60 talk_base::FirewallManager* firewall, | 60 talk_base::FirewallManager* firewall, |
| 61 bool proxy_only, | 61 bool proxy_only, |
| 62 bool previous_login_successful); | 62 bool previous_login_successful); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 void OnClientStateChange(buzz::XmppEngine::State state); | 117 void OnClientStateChange(buzz::XmppEngine::State state); |
| 118 void OnLoginFailure(const LoginFailure& failure); | 118 void OnLoginFailure(const LoginFailure& failure); |
| 119 void OnLogoff(); | 119 void OnLogoff(); |
| 120 void OnAutoReconnectTimerChange(); | 120 void OnAutoReconnectTimerChange(); |
| 121 | 121 |
| 122 void HandleClientStateChange(LoginConnectionState new_state); | 122 void HandleClientStateChange(LoginConnectionState new_state); |
| 123 void ResetUnexpectedDisconnect(); | 123 void ResetUnexpectedDisconnect(); |
| 124 | 124 |
| 125 void OnDisconnectTimeout(); | 125 void OnDisconnectTimeout(); |
| 126 | 126 |
| 127 talk_base::Task* parent_; | 127 talk_base::TaskParent* parent_; |
| 128 scoped_ptr<LoginSettings> login_settings_; | 128 scoped_ptr<LoginSettings> login_settings_; |
| 129 net::NetworkChangeNotifier* network_change_notifier_; | 129 net::NetworkChangeNotifier* network_change_notifier_; |
| 130 AutoReconnect auto_reconnect_; | 130 AutoReconnect auto_reconnect_; |
| 131 SingleLoginAttempt* single_attempt_; | 131 SingleLoginAttempt* single_attempt_; |
| 132 bool successful_connection_; | 132 bool successful_connection_; |
| 133 | 133 |
| 134 LoginConnectionState state_; | 134 LoginConnectionState state_; |
| 135 | 135 |
| 136 // server redirect information | 136 // server redirect information |
| 137 base::Time redirect_time_; | 137 base::Time redirect_time_; |
| 138 std::string redirect_server_; | 138 std::string redirect_server_; |
| 139 int redirect_port_; | 139 int redirect_port_; |
| 140 bool unexpected_disconnect_occurred_; | 140 bool unexpected_disconnect_occurred_; |
| 141 base::OneShotTimer<Login> reset_unexpected_timer_; | 141 base::OneShotTimer<Login> reset_unexpected_timer_; |
| 142 std::string google_host_; | 142 std::string google_host_; |
| 143 std::string google_user_; | 143 std::string google_user_; |
| 144 talk_base::ProxyInfo proxy_info_; | 144 talk_base::ProxyInfo proxy_info_; |
| 145 | 145 |
| 146 base::OneShotTimer<Login> disconnect_timer_; | 146 base::OneShotTimer<Login> disconnect_timer_; |
| 147 | 147 |
| 148 DISALLOW_COPY_AND_ASSIGN(Login); | 148 DISALLOW_COPY_AND_ASSIGN(Login); |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 } // namespace notifier | 151 } // namespace notifier |
| 152 | 152 |
| 153 #endif // CHROME_COMMON_NET_NOTIFIER_COMMUNICATOR_LOGIN_H_ | 153 #endif // CHROME_COMMON_NET_NOTIFIER_COMMUNICATOR_LOGIN_H_ |
| OLD | NEW |