| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 scoped_refptr<RsaKeyPair> host_key_pair_; | 175 scoped_refptr<RsaKeyPair> host_key_pair_; |
| 176 std::unique_ptr<RegisterSupportHostRequest> register_request_; | 176 std::unique_ptr<RegisterSupportHostRequest> register_request_; |
| 177 std::unique_ptr<HostStatusLogger> host_status_logger_; | 177 std::unique_ptr<HostStatusLogger> host_status_logger_; |
| 178 std::unique_ptr<DesktopEnvironmentFactory> desktop_environment_factory_; | 178 std::unique_ptr<DesktopEnvironmentFactory> desktop_environment_factory_; |
| 179 std::unique_ptr<HostEventLogger> host_event_logger_; | 179 std::unique_ptr<HostEventLogger> host_event_logger_; |
| 180 | 180 |
| 181 std::unique_ptr<ChromotingHost> host_; | 181 std::unique_ptr<ChromotingHost> host_; |
| 182 int failed_login_attempts_ = 0; | 182 int failed_login_attempts_ = 0; |
| 183 | 183 |
| 184 std::unique_ptr<PolicyWatcher> policy_watcher_; | 184 std::unique_ptr<PolicyWatcher> policy_watcher_; |
| 185 std::unique_ptr<It2MeConfirmationDialog> confirmation_dialog_; | 185 std::unique_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory_; |
| 186 std::unique_ptr<It2MeConfirmationDialogProxy> confirmation_dialog_proxy_; | 186 std::unique_ptr<It2MeConfirmationDialogProxy> confirmation_dialog_proxy_; |
| 187 | 187 |
| 188 // Host the current nat traversal policy setting. | 188 // Host the current nat traversal policy setting. |
| 189 bool nat_traversal_enabled_ = false; | 189 bool nat_traversal_enabled_ = false; |
| 190 | 190 |
| 191 // The client and host domain policy setting. | 191 // The client and host domain policy setting. |
| 192 std::string required_client_domain_; | 192 std::string required_client_domain_; |
| 193 std::string required_host_domain_; | 193 std::string required_host_domain_; |
| 194 | 194 |
| 195 // Tracks the JID of the remote user when in a connecting state. |
| 196 std::string connecting_jid_; |
| 197 |
| 195 // Indicates whether or not a policy has ever been read. This is to ensure | 198 // Indicates whether or not a policy has ever been read. This is to ensure |
| 196 // that on startup, we do not accidentally start a connection before we have | 199 // that on startup, we do not accidentally start a connection before we have |
| 197 // queried our policy restrictions. | 200 // queried our policy restrictions. |
| 198 bool policy_received_ = false; | 201 bool policy_received_ = false; |
| 199 | 202 |
| 200 // On startup, it is possible to have Connect() called before the policy read | 203 // On startup, it is possible to have Connect() called before the policy read |
| 201 // is completed. Rather than just failing, we thunk the connection call so | 204 // is completed. Rather than just failing, we thunk the connection call so |
| 202 // it can be executed after at least one successful policy read. This | 205 // it can be executed after at least one successful policy read. This |
| 203 // variable contains the thunk if it is necessary. | 206 // variable contains the thunk if it is necessary. |
| 204 base::Closure pending_connect_; | 207 base::Closure pending_connect_; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 226 const std::string& username, | 229 const std::string& username, |
| 227 const std::string& directory_bot_jid); | 230 const std::string& directory_bot_jid); |
| 228 | 231 |
| 229 private: | 232 private: |
| 230 DISALLOW_COPY_AND_ASSIGN(It2MeHostFactory); | 233 DISALLOW_COPY_AND_ASSIGN(It2MeHostFactory); |
| 231 }; | 234 }; |
| 232 | 235 |
| 233 } // namespace remoting | 236 } // namespace remoting |
| 234 | 237 |
| 235 #endif // REMOTING_HOST_IT2ME_IT2ME_HOST_H_ | 238 #endif // REMOTING_HOST_IT2ME_IT2ME_HOST_H_ |
| OLD | NEW |