| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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<It2MeConfirmationDialog> confirmation_dialog, |
| 69 base::WeakPtr<It2MeHost::Observer> observer, | 69 base::WeakPtr<It2MeHost::Observer> observer, |
| 70 const XmppSignalStrategy::XmppServerConfig& xmpp_server_config, | 70 std::unique_ptr<SignalStrategy> signal_strategy, |
| 71 const std::string& username, |
| 71 const std::string& directory_bot_jid); | 72 const std::string& directory_bot_jid); |
| 72 | 73 |
| 73 // Methods called by the script object, from the plugin thread. | 74 // Methods called by the script object, from the plugin thread. |
| 74 | 75 |
| 75 // Creates It2Me host structures and starts the host. | 76 // Creates It2Me host structures and starts the host. |
| 76 virtual void Connect(); | 77 virtual void Connect(); |
| 77 | 78 |
| 78 // Disconnects and shuts down the host. | 79 // Disconnects and shuts down the host. |
| 79 virtual void Disconnect(); | 80 virtual void Disconnect(); |
| 80 | 81 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 149 |
| 149 // Uses details of the connection and current policies to determine if the | 150 // Uses details of the connection and current policies to determine if the |
| 150 // connection should be accepted or rejected. | 151 // connection should be accepted or rejected. |
| 151 void ValidateConnectionDetails( | 152 void ValidateConnectionDetails( |
| 152 const std::string& remote_jid, | 153 const std::string& remote_jid, |
| 153 const protocol::ValidatingAuthenticator::ResultCallback& result_callback); | 154 const protocol::ValidatingAuthenticator::ResultCallback& result_callback); |
| 154 | 155 |
| 155 // Caller supplied fields. | 156 // Caller supplied fields. |
| 156 std::unique_ptr<ChromotingHostContext> host_context_; | 157 std::unique_ptr<ChromotingHostContext> host_context_; |
| 157 base::WeakPtr<It2MeHost::Observer> observer_; | 158 base::WeakPtr<It2MeHost::Observer> observer_; |
| 158 XmppSignalStrategy::XmppServerConfig xmpp_server_config_; | 159 std::unique_ptr<SignalStrategy> signal_strategy_; |
| 160 std::string username_; |
| 159 std::string directory_bot_jid_; | 161 std::string directory_bot_jid_; |
| 160 | 162 |
| 161 It2MeHostState state_ = kDisconnected; | 163 It2MeHostState state_ = kDisconnected; |
| 162 | 164 |
| 163 scoped_refptr<RsaKeyPair> host_key_pair_; | 165 scoped_refptr<RsaKeyPair> host_key_pair_; |
| 164 std::unique_ptr<SignalStrategy> signal_strategy_; | |
| 165 std::unique_ptr<RegisterSupportHostRequest> register_request_; | 166 std::unique_ptr<RegisterSupportHostRequest> register_request_; |
| 166 std::unique_ptr<HostStatusLogger> host_status_logger_; | 167 std::unique_ptr<HostStatusLogger> host_status_logger_; |
| 167 std::unique_ptr<DesktopEnvironmentFactory> desktop_environment_factory_; | 168 std::unique_ptr<DesktopEnvironmentFactory> desktop_environment_factory_; |
| 168 std::unique_ptr<HostEventLogger> host_event_logger_; | 169 std::unique_ptr<HostEventLogger> host_event_logger_; |
| 169 | 170 |
| 170 std::unique_ptr<ChromotingHost> host_; | 171 std::unique_ptr<ChromotingHost> host_; |
| 171 int failed_login_attempts_ = 0; | 172 int failed_login_attempts_ = 0; |
| 172 | 173 |
| 173 std::unique_ptr<PolicyWatcher> policy_watcher_; | 174 std::unique_ptr<PolicyWatcher> policy_watcher_; |
| 174 std::unique_ptr<It2MeConfirmationDialog> confirmation_dialog_; | 175 std::unique_ptr<It2MeConfirmationDialog> confirmation_dialog_; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 | 209 |
| 209 // |policy_service| is used for creating the policy watcher for new | 210 // |policy_service| is used for creating the policy watcher for new |
| 210 // instances of It2MeHost on ChromeOS. The caller must ensure that | 211 // instances of It2MeHost on ChromeOS. The caller must ensure that |
| 211 // |policy_service| is valid throughout the lifetime of each created It2MeHost | 212 // |policy_service| is valid throughout the lifetime of each created It2MeHost |
| 212 // object. This is currently possible because |policy_service| is a global | 213 // object. This is currently possible because |policy_service| is a global |
| 213 // singleton available from the browser process. | 214 // singleton available from the browser process. |
| 214 virtual scoped_refptr<It2MeHost> CreateIt2MeHost( | 215 virtual scoped_refptr<It2MeHost> CreateIt2MeHost( |
| 215 std::unique_ptr<ChromotingHostContext> context, | 216 std::unique_ptr<ChromotingHostContext> context, |
| 216 policy::PolicyService* policy_service, | 217 policy::PolicyService* policy_service, |
| 217 base::WeakPtr<It2MeHost::Observer> observer, | 218 base::WeakPtr<It2MeHost::Observer> observer, |
| 218 const XmppSignalStrategy::XmppServerConfig& xmpp_server_config, | 219 std::unique_ptr<SignalStrategy> signal_strategy, |
| 220 const std::string& username, |
| 219 const std::string& directory_bot_jid); | 221 const std::string& directory_bot_jid); |
| 220 | 222 |
| 221 private: | 223 private: |
| 222 DISALLOW_COPY_AND_ASSIGN(It2MeHostFactory); | 224 DISALLOW_COPY_AND_ASSIGN(It2MeHostFactory); |
| 223 }; | 225 }; |
| 224 | 226 |
| 225 } // namespace remoting | 227 } // namespace remoting |
| 226 | 228 |
| 227 #endif // REMOTING_HOST_IT2ME_IT2ME_HOST_H_ | 229 #endif // REMOTING_HOST_IT2ME_IT2ME_HOST_H_ |
| OLD | NEW |