Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(852)

Side by Side Diff: remoting/host/it2me/it2me_host.h

Issue 2682473003: Add support for multiple allowed domains (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 137
137 // Called when initial policies are read, and when they change. 138 // Called when initial policies are read, and when they change.
138 void OnPolicyUpdate(std::unique_ptr<base::DictionaryValue> policies); 139 void OnPolicyUpdate(std::unique_ptr<base::DictionaryValue> policies);
139 140
140 // Called when malformed policies are detected. 141 // Called when malformed policies are detected.
141 void OnPolicyError(); 142 void OnPolicyError();
142 143
143 // Handlers for NAT traversal and domain policies. 144 // Handlers for NAT traversal and domain policies.
144 void UpdateNatPolicy(bool nat_traversal_enabled); 145 void UpdateNatPolicy(bool nat_traversal_enabled);
145 void UpdateHostDomainPolicy(const std::string& host_domain); 146 void UpdateHostDomainPolicy(const std::string& host_domain);
147 void UpdateHostDomainListPolicy(std::vector<std::string> host_domain_list);
146 void UpdateClientDomainPolicy(const std::string& client_domain); 148 void UpdateClientDomainPolicy(const std::string& client_domain);
149 void UpdateClientDomainListPolicy(
150 std::vector<std::string> client_domain_list);
147 151
148 void DisconnectOnNetworkThread(); 152 void DisconnectOnNetworkThread();
149 153
150 // Uses details of the connection and current policies to determine if the 154 // Uses details of the connection and current policies to determine if the
151 // connection should be accepted or rejected. 155 // connection should be accepted or rejected.
152 void ValidateConnectionDetails( 156 void ValidateConnectionDetails(
153 const std::string& remote_jid, 157 const std::string& remote_jid,
154 const protocol::ValidatingAuthenticator::ResultCallback& result_callback); 158 const protocol::ValidatingAuthenticator::ResultCallback& result_callback);
155 159
156 // Caller supplied fields. 160 // Caller supplied fields.
(...skipping 16 matching lines...) Expand all
173 177
174 std::unique_ptr<PolicyWatcher> policy_watcher_; 178 std::unique_ptr<PolicyWatcher> policy_watcher_;
175 std::unique_ptr<It2MeConfirmationDialog> confirmation_dialog_; 179 std::unique_ptr<It2MeConfirmationDialog> confirmation_dialog_;
176 std::unique_ptr<It2MeConfirmationDialogProxy> confirmation_dialog_proxy_; 180 std::unique_ptr<It2MeConfirmationDialogProxy> confirmation_dialog_proxy_;
177 181
178 // Host the current nat traversal policy setting. 182 // Host the current nat traversal policy setting.
179 bool nat_traversal_enabled_ = false; 183 bool nat_traversal_enabled_ = false;
180 184
181 // The client and host domain policy setting. 185 // The client and host domain policy setting.
182 std::string required_client_domain_; 186 std::string required_client_domain_;
187 std::vector<std::string> required_client_domain_list_;
183 std::string required_host_domain_; 188 std::string required_host_domain_;
189 std::vector<std::string> required_host_domain_list_;
184 190
185 // Indicates whether or not a policy has ever been read. This is to ensure 191 // 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 192 // that on startup, we do not accidentally start a connection before we have
187 // queried our policy restrictions. 193 // queried our policy restrictions.
188 bool policy_received_ = false; 194 bool policy_received_ = false;
189 195
190 // On startup, it is possible to have Connect() called before the policy read 196 // 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 197 // 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 198 // it can be executed after at least one successful policy read. This
193 // variable contains the thunk if it is necessary. 199 // variable contains the thunk if it is necessary.
(...skipping 26 matching lines...) Expand all
220 const std::string& username, 226 const std::string& username,
221 const std::string& directory_bot_jid); 227 const std::string& directory_bot_jid);
222 228
223 private: 229 private:
224 DISALLOW_COPY_AND_ASSIGN(It2MeHostFactory); 230 DISALLOW_COPY_AND_ASSIGN(It2MeHostFactory);
225 }; 231 };
226 232
227 } // namespace remoting 233 } // namespace remoting
228 234
229 #endif // REMOTING_HOST_IT2ME_IT2ME_HOST_H_ 235 #endif // REMOTING_HOST_IT2ME_IT2ME_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698