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/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
9 #include "base/threading/platform_thread.h" | 10 #include "base/threading/platform_thread.h" |
10 #include "net/socket/client_socket_factory.h" | 11 #include "net/socket/client_socket_factory.h" |
11 #include "policy/policy_constants.h" | 12 #include "policy/policy_constants.h" |
12 #include "remoting/base/auto_thread.h" | 13 #include "remoting/base/auto_thread.h" |
13 #include "remoting/base/logging.h" | 14 #include "remoting/base/logging.h" |
14 #include "remoting/base/rsa_key_pair.h" | 15 #include "remoting/base/rsa_key_pair.h" |
15 #include "remoting/host/chromoting_host.h" | 16 #include "remoting/host/chromoting_host.h" |
16 #include "remoting/host/chromoting_host_context.h" | 17 #include "remoting/host/chromoting_host_context.h" |
17 #include "remoting/host/host_event_logger.h" | 18 #include "remoting/host/host_event_logger.h" |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 UpdateNatPolicy(nat_policy); | 365 UpdateNatPolicy(nat_policy); |
365 } | 366 } |
366 std::string host_domain; | 367 std::string host_domain; |
367 if (policies->GetString(policy::key::kRemoteAccessHostDomain, &host_domain)) { | 368 if (policies->GetString(policy::key::kRemoteAccessHostDomain, &host_domain)) { |
368 UpdateHostDomainPolicy(host_domain); | 369 UpdateHostDomainPolicy(host_domain); |
369 } | 370 } |
370 | 371 |
371 policy_received_ = true; | 372 policy_received_ = true; |
372 | 373 |
373 if (!pending_connect_.is_null()) { | 374 if (!pending_connect_.is_null()) { |
374 pending_connect_.Run(); | 375 base::ResetAndReturn(&pending_connect_).Run(); |
375 pending_connect_.Reset(); | |
376 } | 376 } |
377 } | 377 } |
378 | 378 |
379 void It2MeHost::OnPolicyError() { | 379 void It2MeHost::OnPolicyError() { |
380 // TODO(lukasza): Report the policy error to the user. crbug.com/433009 | 380 // TODO(lukasza): Report the policy error to the user. crbug.com/433009 |
381 NOTIMPLEMENTED(); | 381 NOTIMPLEMENTED(); |
382 } | 382 } |
383 | 383 |
384 void It2MeHost::UpdateNatPolicy(bool nat_traversal_enabled) { | 384 void It2MeHost::UpdateNatPolicy(bool nat_traversal_enabled) { |
385 DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread()); | 385 DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread()); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( | 530 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( |
531 new It2MeConfirmationDialogFactory()); | 531 new It2MeConfirmationDialogFactory()); |
532 scoped_ptr<PolicyWatcher> policy_watcher = | 532 scoped_ptr<PolicyWatcher> policy_watcher = |
533 PolicyWatcher::Create(policy_service_, context->file_task_runner()); | 533 PolicyWatcher::Create(policy_service_, context->file_task_runner()); |
534 return new It2MeHost(context.Pass(), policy_watcher.Pass(), | 534 return new It2MeHost(context.Pass(), policy_watcher.Pass(), |
535 confirmation_dialog_factory.Pass(), | 535 confirmation_dialog_factory.Pass(), |
536 observer, xmpp_server_config, directory_bot_jid); | 536 observer, xmpp_server_config, directory_bot_jid); |
537 } | 537 } |
538 | 538 |
539 } // namespace remoting | 539 } // namespace remoting |
OLD | NEW |