OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_IT2ME_IT2ME_HOST_H_ | 5 #ifndef REMOTING_HOST_IT2ME_IT2ME_HOST_H_ |
6 #define REMOTING_HOST_IT2ME_IT2ME_HOST_H_ | 6 #define REMOTING_HOST_IT2ME_IT2ME_HOST_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 virtual void OnClientAuthenticated(const std::string& client_username) = 0; | 58 virtual void OnClientAuthenticated(const std::string& client_username) = 0; |
59 virtual void OnStoreAccessCode(const std::string& access_code, | 59 virtual void OnStoreAccessCode(const std::string& access_code, |
60 base::TimeDelta access_code_lifetime) = 0; | 60 base::TimeDelta access_code_lifetime) = 0; |
61 virtual void OnNatPolicyChanged(bool nat_traversal_enabled) = 0; | 61 virtual void OnNatPolicyChanged(bool nat_traversal_enabled) = 0; |
62 virtual void OnStateChanged(It2MeHostState state, | 62 virtual void OnStateChanged(It2MeHostState state, |
63 const std::string& error_message) = 0; | 63 const std::string& error_message) = 0; |
64 }; | 64 }; |
65 | 65 |
66 It2MeHost(std::unique_ptr<ChromotingHostContext> context, | 66 It2MeHost(std::unique_ptr<ChromotingHostContext> context, |
67 std::unique_ptr<PolicyWatcher> policy_watcher, | 67 std::unique_ptr<PolicyWatcher> policy_watcher, |
68 std::unique_ptr<It2MeConfirmationDialog> confirmation_dialog, | 68 std::unique_ptr<It2MeConfirmationDialogFactory> dialog_factory_, |
69 base::WeakPtr<It2MeHost::Observer> observer, | 69 base::WeakPtr<It2MeHost::Observer> observer, |
70 std::unique_ptr<SignalStrategy> signal_strategy, | 70 std::unique_ptr<SignalStrategy> signal_strategy, |
71 const std::string& username, | 71 const std::string& username, |
72 const std::string& directory_bot_jid); | 72 const std::string& directory_bot_jid); |
73 | 73 |
74 // Methods called by the script object, from the plugin thread. | 74 // Methods called by the script object, from the plugin thread. |
75 | 75 |
76 // Creates It2Me host structures and starts the host. | 76 // Creates It2Me host structures and starts the host. |
77 virtual void Connect(); | 77 virtual void Connect(); |
78 | 78 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 scoped_refptr<RsaKeyPair> host_key_pair_; | 165 scoped_refptr<RsaKeyPair> host_key_pair_; |
166 std::unique_ptr<RegisterSupportHostRequest> register_request_; | 166 std::unique_ptr<RegisterSupportHostRequest> register_request_; |
167 std::unique_ptr<HostStatusLogger> host_status_logger_; | 167 std::unique_ptr<HostStatusLogger> host_status_logger_; |
168 std::unique_ptr<DesktopEnvironmentFactory> desktop_environment_factory_; | 168 std::unique_ptr<DesktopEnvironmentFactory> desktop_environment_factory_; |
169 std::unique_ptr<HostEventLogger> host_event_logger_; | 169 std::unique_ptr<HostEventLogger> host_event_logger_; |
170 | 170 |
171 std::unique_ptr<ChromotingHost> host_; | 171 std::unique_ptr<ChromotingHost> host_; |
172 int failed_login_attempts_ = 0; | 172 int failed_login_attempts_ = 0; |
173 | 173 |
174 std::unique_ptr<PolicyWatcher> policy_watcher_; | 174 std::unique_ptr<PolicyWatcher> policy_watcher_; |
175 std::unique_ptr<It2MeConfirmationDialog> confirmation_dialog_; | 175 std::unique_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory_; |
176 std::unique_ptr<It2MeConfirmationDialogProxy> confirmation_dialog_proxy_; | 176 std::unique_ptr<It2MeConfirmationDialogProxy> confirmation_dialog_proxy_; |
177 | 177 |
178 // Host the current nat traversal policy setting. | 178 // Host the current nat traversal policy setting. |
179 bool nat_traversal_enabled_ = false; | 179 bool nat_traversal_enabled_ = false; |
180 | 180 |
181 // The client and host domain policy setting. | 181 // The client and host domain policy setting. |
182 std::string required_client_domain_; | 182 std::string required_client_domain_; |
183 std::string required_host_domain_; | 183 std::string required_host_domain_; |
184 | 184 |
| 185 // Tracks the JID of the remote user when in a connecting state. |
| 186 std::string connecting_jid_; |
| 187 |
185 // Indicates whether or not a policy has ever been read. This is to ensure | 188 // Indicates whether or not a policy has ever been read. This is to ensure |
186 // that on startup, we do not accidentally start a connection before we have | 189 // that on startup, we do not accidentally start a connection before we have |
187 // queried our policy restrictions. | 190 // queried our policy restrictions. |
188 bool policy_received_ = false; | 191 bool policy_received_ = false; |
189 | 192 |
190 // On startup, it is possible to have Connect() called before the policy read | 193 // On startup, it is possible to have Connect() called before the policy read |
191 // is completed. Rather than just failing, we thunk the connection call so | 194 // is completed. Rather than just failing, we thunk the connection call so |
192 // it can be executed after at least one successful policy read. This | 195 // it can be executed after at least one successful policy read. This |
193 // variable contains the thunk if it is necessary. | 196 // variable contains the thunk if it is necessary. |
194 base::Closure pending_connect_; | 197 base::Closure pending_connect_; |
(...skipping 21 matching lines...) Expand all Loading... |
216 const std::string& username, | 219 const std::string& username, |
217 const std::string& directory_bot_jid); | 220 const std::string& directory_bot_jid); |
218 | 221 |
219 private: | 222 private: |
220 DISALLOW_COPY_AND_ASSIGN(It2MeHostFactory); | 223 DISALLOW_COPY_AND_ASSIGN(It2MeHostFactory); |
221 }; | 224 }; |
222 | 225 |
223 } // namespace remoting | 226 } // namespace remoting |
224 | 227 |
225 #endif // REMOTING_HOST_IT2ME_IT2ME_HOST_H_ | 228 #endif // REMOTING_HOST_IT2ME_IT2ME_HOST_H_ |
OLD | NEW |