| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 REMOTING_SIGNALING_XMPP_LOGIN_HANDLER_H_ | 5 #ifndef REMOTING_SIGNALING_XMPP_LOGIN_HANDLER_H_ |
| 6 #define REMOTING_SIGNALING_XMPP_LOGIN_HANDLER_H_ | 6 #define REMOTING_SIGNALING_XMPP_LOGIN_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // to send outgoing messages and calls Delegate::OnHandshakeDone() after | 28 // to send outgoing messages and calls Delegate::OnHandshakeDone() after |
| 29 // authentication is finished successfully or Delegate::OnError() on error. | 29 // authentication is finished successfully or Delegate::OnError() on error. |
| 30 // | 30 // |
| 31 // See RFC3920 for description of XMPP and authentication handshake. | 31 // See RFC3920 for description of XMPP and authentication handshake. |
| 32 class XmppLoginHandler { | 32 class XmppLoginHandler { |
| 33 public: | 33 public: |
| 34 class Delegate { | 34 class Delegate { |
| 35 public: | 35 public: |
| 36 Delegate() {} | 36 Delegate() {} |
| 37 | 37 |
| 38 // All Delegate methods are allowed to destroy XmppLoginHandler. |
| 38 virtual void SendMessage(const std::string& message) = 0; | 39 virtual void SendMessage(const std::string& message) = 0; |
| 39 virtual void StartTls() = 0; | 40 virtual void StartTls() = 0; |
| 40 virtual void OnHandshakeDone(const std::string& jid, | 41 virtual void OnHandshakeDone(const std::string& jid, |
| 41 scoped_ptr<XmppStreamParser> parser) = 0; | 42 scoped_ptr<XmppStreamParser> parser) = 0; |
| 42 virtual void OnLoginHandlerError(SignalStrategy::Error error) = 0; | 43 virtual void OnLoginHandlerError(SignalStrategy::Error error) = 0; |
| 43 | 44 |
| 44 protected: | 45 protected: |
| 45 virtual ~Delegate() {} | 46 virtual ~Delegate() {} |
| 46 }; | 47 }; |
| 47 | 48 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 std::string jid_; | 134 std::string jid_; |
| 134 | 135 |
| 135 scoped_ptr<XmppStreamParser> stream_parser_; | 136 scoped_ptr<XmppStreamParser> stream_parser_; |
| 136 | 137 |
| 137 DISALLOW_COPY_AND_ASSIGN(XmppLoginHandler); | 138 DISALLOW_COPY_AND_ASSIGN(XmppLoginHandler); |
| 138 }; | 139 }; |
| 139 | 140 |
| 140 } // namespace remoting | 141 } // namespace remoting |
| 141 | 142 |
| 142 #endif // REMOTING_SIGNALING_XMPP_LOGIN_HANDLER_H_ | 143 #endif // REMOTING_SIGNALING_XMPP_LOGIN_HANDLER_H_ |
| OLD | NEW |