| 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 #include <vector> |
| 10 | 11 |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 14 #include "remoting/host/host_status_observer.h" | 15 #include "remoting/host/host_status_observer.h" |
| 15 #include "remoting/host/it2me/it2me_confirmation_dialog.h" | 16 #include "remoting/host/it2me/it2me_confirmation_dialog.h" |
| 16 #include "remoting/host/it2me/it2me_confirmation_dialog_proxy.h" | 17 #include "remoting/host/it2me/it2me_confirmation_dialog_proxy.h" |
| 17 #include "remoting/protocol/validating_authenticator.h" | 18 #include "remoting/protocol/validating_authenticator.h" |
| 18 #include "remoting/signaling/xmpp_signal_strategy.h" | 19 #include "remoting/signaling/xmpp_signal_strategy.h" |
| 19 | 20 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 const std::string& error_message); | 131 const std::string& error_message); |
| 131 | 132 |
| 132 // Called when initial policies are read, and when they change. | 133 // Called when initial policies are read, and when they change. |
| 133 void OnPolicyUpdate(std::unique_ptr<base::DictionaryValue> policies); | 134 void OnPolicyUpdate(std::unique_ptr<base::DictionaryValue> policies); |
| 134 | 135 |
| 135 // Called when malformed policies are detected. | 136 // Called when malformed policies are detected. |
| 136 void OnPolicyError(); | 137 void OnPolicyError(); |
| 137 | 138 |
| 138 // Handlers for NAT traversal and domain policies. | 139 // Handlers for NAT traversal and domain policies. |
| 139 void UpdateNatPolicy(bool nat_traversal_enabled); | 140 void UpdateNatPolicy(bool nat_traversal_enabled); |
| 140 void UpdateHostDomainPolicy(const std::string& host_domain); | 141 void UpdateHostDomainListPolicy(std::vector<std::string> host_domain_list); |
| 141 void UpdateClientDomainPolicy(const std::string& client_domain); | 142 void UpdateClientDomainListPolicy( |
| 143 std::vector<std::string> client_domain_list); |
| 142 | 144 |
| 143 void DisconnectOnNetworkThread(); | 145 void DisconnectOnNetworkThread(); |
| 144 | 146 |
| 145 // Uses details of the connection and current policies to determine if the | 147 // Uses details of the connection and current policies to determine if the |
| 146 // connection should be accepted or rejected. | 148 // connection should be accepted or rejected. |
| 147 void ValidateConnectionDetails( | 149 void ValidateConnectionDetails( |
| 148 const std::string& remote_jid, | 150 const std::string& remote_jid, |
| 149 const protocol::ValidatingAuthenticator::ResultCallback& result_callback); | 151 const protocol::ValidatingAuthenticator::ResultCallback& result_callback); |
| 150 | 152 |
| 151 // Caller supplied fields. | 153 // Caller supplied fields. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 167 int failed_login_attempts_ = 0; | 169 int failed_login_attempts_ = 0; |
| 168 | 170 |
| 169 std::unique_ptr<PolicyWatcher> policy_watcher_; | 171 std::unique_ptr<PolicyWatcher> policy_watcher_; |
| 170 std::unique_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory_; | 172 std::unique_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory_; |
| 171 std::unique_ptr<It2MeConfirmationDialogProxy> confirmation_dialog_proxy_; | 173 std::unique_ptr<It2MeConfirmationDialogProxy> confirmation_dialog_proxy_; |
| 172 | 174 |
| 173 // Host the current nat traversal policy setting. | 175 // Host the current nat traversal policy setting. |
| 174 bool nat_traversal_enabled_ = false; | 176 bool nat_traversal_enabled_ = false; |
| 175 | 177 |
| 176 // The client and host domain policy setting. | 178 // The client and host domain policy setting. |
| 177 std::string required_client_domain_; | 179 std::vector<std::string> required_client_domain_list_; |
| 178 std::string required_host_domain_; | 180 std::vector<std::string> required_host_domain_list_; |
| 179 | 181 |
| 180 // Tracks the JID of the remote user when in a connecting state. | 182 // Tracks the JID of the remote user when in a connecting state. |
| 181 std::string connecting_jid_; | 183 std::string connecting_jid_; |
| 182 | 184 |
| 183 // Indicates whether or not a policy has ever been read. This is to ensure | 185 // Indicates whether or not a policy has ever been read. This is to ensure |
| 184 // that on startup, we do not accidentally start a connection before we have | 186 // that on startup, we do not accidentally start a connection before we have |
| 185 // queried our policy restrictions. | 187 // queried our policy restrictions. |
| 186 bool policy_received_ = false; | 188 bool policy_received_ = false; |
| 187 | 189 |
| 188 // On startup, it is possible to have Connect() called before the policy read | 190 // On startup, it is possible to have Connect() called before the policy read |
| (...skipping 25 matching lines...) Expand all Loading... |
| 214 const std::string& username, | 216 const std::string& username, |
| 215 const std::string& directory_bot_jid); | 217 const std::string& directory_bot_jid); |
| 216 | 218 |
| 217 private: | 219 private: |
| 218 DISALLOW_COPY_AND_ASSIGN(It2MeHostFactory); | 220 DISALLOW_COPY_AND_ASSIGN(It2MeHostFactory); |
| 219 }; | 221 }; |
| 220 | 222 |
| 221 } // namespace remoting | 223 } // namespace remoting |
| 222 | 224 |
| 223 #endif // REMOTING_HOST_IT2ME_IT2ME_HOST_H_ | 225 #endif // REMOTING_HOST_IT2ME_IT2ME_HOST_H_ |
| OLD | NEW |