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_, | 200 std::string("@") + required_host_domain_, false)) { |
201 base::CompareCase::INSENSITIVE_ASCII)) { | |
202 SetState(kInvalidDomainError, ""); | 201 SetState(kInvalidDomainError, ""); |
203 return; | 202 return; |
204 } | 203 } |
205 | 204 |
206 // Generate a key pair for the Host to use. | 205 // Generate a key pair for the Host to use. |
207 // TODO(wez): Move this to the worker thread. | 206 // TODO(wez): Move this to the worker thread. |
208 host_key_pair_ = RsaKeyPair::Generate(); | 207 host_key_pair_ = RsaKeyPair::Generate(); |
209 | 208 |
210 // Create XMPP connection. | 209 // Create XMPP connection. |
211 scoped_ptr<SignalStrategy> signal_strategy( | 210 scoped_ptr<SignalStrategy> signal_strategy( |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( | 532 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( |
534 new It2MeConfirmationDialogFactory()); | 533 new It2MeConfirmationDialogFactory()); |
535 scoped_ptr<PolicyWatcher> policy_watcher = | 534 scoped_ptr<PolicyWatcher> policy_watcher = |
536 PolicyWatcher::Create(policy_service_, context->file_task_runner()); | 535 PolicyWatcher::Create(policy_service_, context->file_task_runner()); |
537 return new It2MeHost(context.Pass(), policy_watcher.Pass(), | 536 return new It2MeHost(context.Pass(), policy_watcher.Pass(), |
538 confirmation_dialog_factory.Pass(), | 537 confirmation_dialog_factory.Pass(), |
539 observer, xmpp_server_config, directory_bot_jid); | 538 observer, xmpp_server_config, directory_bot_jid); |
540 } | 539 } |
541 | 540 |
542 } // namespace remoting | 541 } // namespace remoting |
OLD | NEW |