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 #ifndef JINGLE_NOTIFIER_COMMUNICATOR_LOGIN_H_ | 5 #ifndef JINGLE_NOTIFIER_COMMUNICATOR_LOGIN_H_ |
6 #define JINGLE_NOTIFIER_COMMUNICATOR_LOGIN_H_ | 6 #define JINGLE_NOTIFIER_COMMUNICATOR_LOGIN_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
| 10 #include "base/compiler_specific.h" |
10 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
13 #include "base/time.h" | 14 #include "base/time.h" |
14 #include "base/timer.h" | 15 #include "base/timer.h" |
15 #include "jingle/notifier/base/server_information.h" | 16 #include "jingle/notifier/base/server_information.h" |
16 #include "jingle/notifier/communicator/single_login_attempt.h" | 17 #include "jingle/notifier/communicator/single_login_attempt.h" |
17 #include "net/base/network_change_notifier.h" | 18 #include "net/base/network_change_notifier.h" |
18 #include "talk/xmpp/xmppengine.h" | 19 #include "talk/xmpp/xmppengine.h" |
19 | 20 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 bool try_ssltcp_first, | 63 bool try_ssltcp_first, |
63 const std::string& auth_mechanism); | 64 const std::string& auth_mechanism); |
64 virtual ~Login(); | 65 virtual ~Login(); |
65 | 66 |
66 void StartConnection(); | 67 void StartConnection(); |
67 // The updated settings only take effect the next time StartConnection | 68 // The updated settings only take effect the next time StartConnection |
68 // is called. | 69 // is called. |
69 void UpdateXmppSettings(const buzz::XmppClientSettings& user_settings); | 70 void UpdateXmppSettings(const buzz::XmppClientSettings& user_settings); |
70 | 71 |
71 // net::NetworkChangeNotifier::IPAddressObserver implementation. | 72 // net::NetworkChangeNotifier::IPAddressObserver implementation. |
72 virtual void OnIPAddressChanged(); | 73 virtual void OnIPAddressChanged() OVERRIDE; |
73 | 74 |
74 // SingleLoginAttempt::Delegate implementation. | 75 // SingleLoginAttempt::Delegate implementation. |
75 virtual void OnConnect( | 76 virtual void OnConnect( |
76 base::WeakPtr<buzz::XmppTaskParentInterface> base_task); | 77 base::WeakPtr<buzz::XmppTaskParentInterface> base_task) OVERRIDE; |
77 virtual void OnNeedReconnect(); | 78 virtual void OnNeedReconnect() OVERRIDE; |
78 virtual void OnRedirect(const std::string& redirect_server, | 79 virtual void OnRedirect(const std::string& redirect_server, |
79 int redirect_port); | 80 int redirect_port) OVERRIDE; |
80 | 81 |
81 private: | 82 private: |
82 void OnLogoff(); | 83 void OnLogoff(); |
83 | 84 |
84 // Stops any existing reconnect timer and sets an initial reconnect | 85 // Stops any existing reconnect timer and sets an initial reconnect |
85 // interval. | 86 // interval. |
86 void ResetReconnectState(); | 87 void ResetReconnectState(); |
87 | 88 |
88 // Tries to reconnect in some point in the future. If called | 89 // Tries to reconnect in some point in the future. If called |
89 // repeatedly, will wait longer and longer until reconnecting. | 90 // repeatedly, will wait longer and longer until reconnecting. |
(...skipping 19 matching lines...) Expand all Loading... |
109 DISALLOW_COPY_AND_ASSIGN(Login); | 110 DISALLOW_COPY_AND_ASSIGN(Login); |
110 }; | 111 }; |
111 | 112 |
112 // Workaround for MSVS 2005 bug that fails to handle inheritance from a nested | 113 // Workaround for MSVS 2005 bug that fails to handle inheritance from a nested |
113 // class properly if it comes directly on a base class list. | 114 // class properly if it comes directly on a base class list. |
114 typedef Login::Delegate LoginDelegate; | 115 typedef Login::Delegate LoginDelegate; |
115 | 116 |
116 } // namespace notifier | 117 } // namespace notifier |
117 | 118 |
118 #endif // JINGLE_NOTIFIER_COMMUNICATOR_LOGIN_H_ | 119 #endif // JINGLE_NOTIFIER_COMMUNICATOR_LOGIN_H_ |
OLD | NEW |