Index: jingle/notifier/communicator/login.h |
diff --git a/jingle/notifier/communicator/login.h b/jingle/notifier/communicator/login.h |
index d089cb6d62918c3b31b707a1d2e1833c07660191..29be4039c2d489eb46ce0af282569c55430bf8f4 100644 |
--- a/jingle/notifier/communicator/login.h |
+++ b/jingle/notifier/communicator/login.h |
@@ -33,24 +33,31 @@ namespace notifier { |
class LoginSettings; |
-// Workaround for MSVS 2005 bug that fails to handle inheritance from a nested |
-// class properly if it comes directly on a base class list. |
-typedef SingleLoginAttempt::Delegate SingleLoginAttemptDelegate; |
- |
-// Does the login, keeps it alive (with refreshing cookies and reattempting |
-// login when disconnected), figures out what actions to take on the various |
-// errors that may occur. |
+// Does the login, keeps it alive (with refreshing cookies and |
+// reattempting login when disconnected), and figures out what actions |
+// to take on the various errors that may occur. |
class Login : public net::NetworkChangeNotifier::IPAddressObserver, |
- public SingleLoginAttemptDelegate { |
+ public SingleLoginAttempt::Delegate { |
public: |
class Delegate { |
public: |
+ // Called when a connection has been successfully established. |
virtual void OnConnect( |
base::WeakPtr<buzz::XmppTaskParentInterface> base_task) = 0; |
- virtual void OnDisconnect() = 0; |
+ |
+ // Called when there's no connection to the server but we expect |
+ // it to come back come back eventually. The connection will be |
+ // retried with exponential backoff. |
+ virtual void OnTransientDisconnection() = 0; |
+ |
+ // Called when the current login credentials have been rejected. |
+ // The connection will still be retried with exponential backoff; |
+ // it's up to the delegate to stop connecting and/or prompt for |
+ // new credentials. |
+ virtual void OnCredentialsRejected() = 0; |
protected: |
- virtual ~Delegate() {} |
+ virtual ~Delegate(); |
}; |
// Does not take ownership of |delegate|, which must not be NULL. |
@@ -63,9 +70,12 @@ class Login : public net::NetworkChangeNotifier::IPAddressObserver, |
const std::string& auth_mechanism); |
virtual ~Login(); |
+ // Starts connecting (or forces a reconnection if we're backed off). |
void StartConnection(); |
- // The updated settings only take effect the next time StartConnection |
- // is called. |
+ |
+ // The updated settings take effect only the next time when a |
+ // connection is attempted (either via reconnection or a call to |
+ // StartConnection()). |
void UpdateXmppSettings(const buzz::XmppClientSettings& user_settings); |
// net::NetworkChangeNotifier::IPAddressObserver implementation. |
@@ -74,8 +84,9 @@ class Login : public net::NetworkChangeNotifier::IPAddressObserver, |
// SingleLoginAttempt::Delegate implementation. |
virtual void OnConnect( |
base::WeakPtr<buzz::XmppTaskParentInterface> base_task) OVERRIDE; |
- virtual void OnNeedReconnect() OVERRIDE; |
virtual void OnRedirect(const ServerInformation& redirect_server) OVERRIDE; |
+ virtual void OnCredentialsRejected() OVERRIDE; |
+ virtual void OnSettingsExhausted() OVERRIDE; |
private: |
void OnLogoff(); |
@@ -103,10 +114,6 @@ class Login : public net::NetworkChangeNotifier::IPAddressObserver, |
DISALLOW_COPY_AND_ASSIGN(Login); |
}; |
-// Workaround for MSVS 2005 bug that fails to handle inheritance from a nested |
-// class properly if it comes directly on a base class list. |
-typedef Login::Delegate LoginDelegate; |
- |
} // namespace notifier |
#endif // JINGLE_NOTIFIER_COMMUNICATOR_LOGIN_H_ |