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 REMOTING_HOST_SUPPORT_HOST_REGISTER_QUERY_H_ | 5 #ifndef REMOTING_HOST_SUPPORT_HOST_REGISTER_QUERY_H_ |
6 #define REMOTING_HOST_SUPPORT_HOST_REGISTER_QUERY_H_ | 6 #define REMOTING_HOST_SUPPORT_HOST_REGISTER_QUERY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // object. Caller must ensure that the callback object is valid | 52 // object. Caller must ensure that the callback object is valid |
53 // while signalling connection exists. Returns false on falure | 53 // while signalling connection exists. Returns false on falure |
54 // (e.g. config is invalid). Callback is never called if the bot | 54 // (e.g. config is invalid). Callback is never called if the bot |
55 // malfunctions and doesn't respond to the request. | 55 // malfunctions and doesn't respond to the request. |
56 bool Init(HostConfig* config, const RegisterCallback& callback); | 56 bool Init(HostConfig* config, const RegisterCallback& callback); |
57 | 57 |
58 // HostStatusObserver implementation. | 58 // HostStatusObserver implementation. |
59 virtual void OnSignallingConnected(SignalStrategy* signal_strategy, | 59 virtual void OnSignallingConnected(SignalStrategy* signal_strategy, |
60 const std::string& full_jid) OVERRIDE; | 60 const std::string& full_jid) OVERRIDE; |
61 virtual void OnSignallingDisconnected() OVERRIDE; | 61 virtual void OnSignallingDisconnected() OVERRIDE; |
62 virtual void OnAuthenticatedClientsChanged(int clients_connected) OVERRIDE; | 62 virtual void OnClientAuthenticated( |
| 63 remoting::protocol::ConnectionToClient* client) OVERRIDE; |
| 64 virtual void OnClientDisconnected( |
| 65 remoting::protocol::ConnectionToClient* client) OVERRIDE; |
63 virtual void OnAccessDenied() OVERRIDE; | 66 virtual void OnAccessDenied() OVERRIDE; |
64 virtual void OnShutdown() OVERRIDE; | 67 virtual void OnShutdown() OVERRIDE; |
65 | 68 |
66 private: | 69 private: |
67 void DoSend(); | 70 void DoSend(); |
68 | 71 |
69 // Caller owns the result. | 72 // Caller owns the result. |
70 buzz::XmlElement* CreateRegistrationRequest(const std::string& jid); | 73 buzz::XmlElement* CreateRegistrationRequest(const std::string& jid); |
71 buzz::XmlElement* CreateSignature(const std::string& jid); | 74 buzz::XmlElement* CreateSignature(const std::string& jid); |
72 | 75 |
73 void ProcessResponse(const buzz::XmlElement* response); | 76 void ProcessResponse(const buzz::XmlElement* response); |
74 bool ParseResponse(const buzz::XmlElement* response, | 77 bool ParseResponse(const buzz::XmlElement* response, |
75 std::string* support_id, base::TimeDelta* lifetime); | 78 std::string* support_id, base::TimeDelta* lifetime); |
76 | 79 |
77 MessageLoop* message_loop_; | 80 MessageLoop* message_loop_; |
78 RegisterCallback callback_; | 81 RegisterCallback callback_; |
79 scoped_ptr<IqRequest> request_; | 82 scoped_ptr<IqRequest> request_; |
80 HostKeyPair key_pair_; | 83 HostKeyPair key_pair_; |
81 | 84 |
82 DISALLOW_COPY_AND_ASSIGN(RegisterSupportHostRequest); | 85 DISALLOW_COPY_AND_ASSIGN(RegisterSupportHostRequest); |
83 }; | 86 }; |
84 | 87 |
85 } // namespace remoting | 88 } // namespace remoting |
86 | 89 |
87 #endif // REMOTING_HOST_SUPPORT_HOST_REGISTER_QUERY_H_ | 90 #endif // REMOTING_HOST_SUPPORT_HOST_REGISTER_QUERY_H_ |
OLD | NEW |