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 #include "remoting/host/it2me/it2me_host.h" | 5 #include "remoting/host/it2me/it2me_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/threading/platform_thread.h" | 10 #include "base/threading/platform_thread.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread()); | 190 DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread()); |
191 | 191 |
192 if (state_ != kStarting) { | 192 if (state_ != kStarting) { |
193 // Host has been stopped while we were fetching policy. | 193 // Host has been stopped while we were fetching policy. |
194 return; | 194 return; |
195 } | 195 } |
196 | 196 |
197 // Check the host domain policy. | 197 // Check the host domain policy. |
198 if (!required_host_domain_.empty() && | 198 if (!required_host_domain_.empty() && |
199 !base::EndsWith(xmpp_server_config_.username, | 199 !base::EndsWith(xmpp_server_config_.username, |
200 std::string("@") + required_host_domain_, false)) { | 200 std::string("@") + required_host_domain_, |
| 201 base::CompareCase::INSENSITIVE_ASCII)) { |
201 SetState(kInvalidDomainError, ""); | 202 SetState(kInvalidDomainError, ""); |
202 return; | 203 return; |
203 } | 204 } |
204 | 205 |
205 // Generate a key pair for the Host to use. | 206 // Generate a key pair for the Host to use. |
206 // TODO(wez): Move this to the worker thread. | 207 // TODO(wez): Move this to the worker thread. |
207 host_key_pair_ = RsaKeyPair::Generate(); | 208 host_key_pair_ = RsaKeyPair::Generate(); |
208 | 209 |
209 // Create XMPP connection. | 210 // Create XMPP connection. |
210 scoped_ptr<SignalStrategy> signal_strategy( | 211 scoped_ptr<SignalStrategy> signal_strategy( |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( | 533 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( |
533 new It2MeConfirmationDialogFactory()); | 534 new It2MeConfirmationDialogFactory()); |
534 scoped_ptr<PolicyWatcher> policy_watcher = | 535 scoped_ptr<PolicyWatcher> policy_watcher = |
535 PolicyWatcher::Create(policy_service_, context->file_task_runner()); | 536 PolicyWatcher::Create(policy_service_, context->file_task_runner()); |
536 return new It2MeHost(context.Pass(), policy_watcher.Pass(), | 537 return new It2MeHost(context.Pass(), policy_watcher.Pass(), |
537 confirmation_dialog_factory.Pass(), | 538 confirmation_dialog_factory.Pass(), |
538 observer, xmpp_server_config, directory_bot_jid); | 539 observer, xmpp_server_config, directory_bot_jid); |
539 } | 540 } |
540 | 541 |
541 } // namespace remoting | 542 } // namespace remoting |
OLD | NEW |