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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // object. Caller must ensure that the callback object is valid | 46 // object. Caller must ensure that the callback object is valid |
47 // while signalling connection exists. Returns false on falure | 47 // while signalling connection exists. Returns false on falure |
48 // (e.g. config is invalid). Callback is never called if the bot | 48 // (e.g. config is invalid). Callback is never called if the bot |
49 // malfunctions and doesn't respond to the request. | 49 // malfunctions and doesn't respond to the request. |
50 bool Init(HostConfig* config, const RegisterCallback& callback); | 50 bool Init(HostConfig* config, const RegisterCallback& callback); |
51 | 51 |
52 // HostStatusObserver implementation. | 52 // HostStatusObserver implementation. |
53 virtual void OnSignallingConnected(SignalStrategy* signal_strategy, | 53 virtual void OnSignallingConnected(SignalStrategy* signal_strategy, |
54 const std::string& full_jid) OVERRIDE; | 54 const std::string& full_jid) OVERRIDE; |
55 virtual void OnSignallingDisconnected() OVERRIDE; | 55 virtual void OnSignallingDisconnected() OVERRIDE; |
| 56 virtual void OnAuthenticatedClientsChanged(int clients_connected) OVERRIDE; |
56 virtual void OnAccessDenied() OVERRIDE; | 57 virtual void OnAccessDenied() OVERRIDE; |
57 virtual void OnShutdown() OVERRIDE; | 58 virtual void OnShutdown() OVERRIDE; |
58 | 59 |
59 private: | 60 private: |
60 void DoSend(); | 61 void DoSend(); |
61 | 62 |
62 // Caller owns the result. | 63 // Caller owns the result. |
63 buzz::XmlElement* CreateRegistrationRequest(const std::string& jid); | 64 buzz::XmlElement* CreateRegistrationRequest(const std::string& jid); |
64 buzz::XmlElement* CreateSignature(const std::string& jid); | 65 buzz::XmlElement* CreateSignature(const std::string& jid); |
65 | 66 |
66 void ProcessResponse(const buzz::XmlElement* response); | 67 void ProcessResponse(const buzz::XmlElement* response); |
67 bool ParseResponse(const buzz::XmlElement* response, std::string* support_id); | 68 bool ParseResponse(const buzz::XmlElement* response, std::string* support_id); |
68 void InvokeCallback(bool result, const std::string& support_id); | 69 void InvokeCallback(bool result, const std::string& support_id); |
69 | 70 |
70 MessageLoop* message_loop_; | 71 MessageLoop* message_loop_; |
71 RegisterCallback callback_; | 72 RegisterCallback callback_; |
72 scoped_ptr<IqRequest> request_; | 73 scoped_ptr<IqRequest> request_; |
73 HostKeyPair key_pair_; | 74 HostKeyPair key_pair_; |
74 | 75 |
75 DISALLOW_COPY_AND_ASSIGN(RegisterSupportHostRequest); | 76 DISALLOW_COPY_AND_ASSIGN(RegisterSupportHostRequest); |
76 }; | 77 }; |
77 | 78 |
78 } // namespace remoting | 79 } // namespace remoting |
79 | 80 |
80 #endif // REMOTING_HOST_SUPPORT_HOST_REGISTER_QUERY_H_ | 81 #endif // REMOTING_HOST_SUPPORT_HOST_REGISTER_QUERY_H_ |
OLD | NEW |