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/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/threading/platform_thread.h" | 9 #include "base/threading/platform_thread.h" |
10 #include "net/socket/client_socket_factory.h" | 10 #include "net/socket/client_socket_factory.h" |
| 11 #include "policy/policy_constants.h" |
11 #include "remoting/base/auto_thread.h" | 12 #include "remoting/base/auto_thread.h" |
12 #include "remoting/base/logging.h" | 13 #include "remoting/base/logging.h" |
13 #include "remoting/base/rsa_key_pair.h" | 14 #include "remoting/base/rsa_key_pair.h" |
14 #include "remoting/host/chromoting_host.h" | 15 #include "remoting/host/chromoting_host.h" |
15 #include "remoting/host/chromoting_host_context.h" | 16 #include "remoting/host/chromoting_host_context.h" |
16 #include "remoting/host/host_event_logger.h" | 17 #include "remoting/host/host_event_logger.h" |
17 #include "remoting/host/host_secret.h" | 18 #include "remoting/host/host_secret.h" |
18 #include "remoting/host/host_status_logger.h" | 19 #include "remoting/host/host_status_logger.h" |
19 #include "remoting/host/it2me/it2me_confirmation_dialog.h" | 20 #include "remoting/host/it2me/it2me_confirmation_dialog.h" |
20 #include "remoting/host/it2me_desktop_environment.h" | 21 #include "remoting/host/it2me_desktop_environment.h" |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 // The policy watcher runs on the |ui_task_runner| on ChromeOS and the | 359 // The policy watcher runs on the |ui_task_runner| on ChromeOS and the |
359 // |network_task_runner| on other platforms. | 360 // |network_task_runner| on other platforms. |
360 if (!host_context_->network_task_runner()->BelongsToCurrentThread()) { | 361 if (!host_context_->network_task_runner()->BelongsToCurrentThread()) { |
361 host_context_->network_task_runner()->PostTask( | 362 host_context_->network_task_runner()->PostTask( |
362 FROM_HERE, | 363 FROM_HERE, |
363 base::Bind(&It2MeHost::OnPolicyUpdate, this, base::Passed(&policies))); | 364 base::Bind(&It2MeHost::OnPolicyUpdate, this, base::Passed(&policies))); |
364 return; | 365 return; |
365 } | 366 } |
366 | 367 |
367 bool nat_policy; | 368 bool nat_policy; |
368 if (policies->GetBoolean(policy_hack::PolicyWatcher::kNatPolicyName, | 369 if (policies->GetBoolean(policy::key::kRemoteAccessHostFirewallTraversal, |
369 &nat_policy)) { | 370 &nat_policy)) { |
370 UpdateNatPolicy(nat_policy); | 371 UpdateNatPolicy(nat_policy); |
371 } | 372 } |
372 std::string host_domain; | 373 std::string host_domain; |
373 if (policies->GetString(policy_hack::PolicyWatcher::kHostDomainPolicyName, | 374 if (policies->GetString(policy::key::kRemoteAccessHostDomain, &host_domain)) { |
374 &host_domain)) { | |
375 UpdateHostDomainPolicy(host_domain); | 375 UpdateHostDomainPolicy(host_domain); |
376 } | 376 } |
377 | 377 |
378 policy_received_ = true; | 378 policy_received_ = true; |
379 | 379 |
380 if (!pending_connect_.is_null()) { | 380 if (!pending_connect_.is_null()) { |
381 pending_connect_.Run(); | 381 pending_connect_.Run(); |
382 pending_connect_.Reset(); | 382 pending_connect_.Reset(); |
383 } | 383 } |
384 } | 384 } |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 new It2MeConfirmationDialogFactory()); | 536 new It2MeConfirmationDialogFactory()); |
537 scoped_ptr<policy_hack::PolicyWatcher> policy_watcher = | 537 scoped_ptr<policy_hack::PolicyWatcher> policy_watcher = |
538 policy_hack::PolicyWatcher::Create(policy_service_, | 538 policy_hack::PolicyWatcher::Create(policy_service_, |
539 context->network_task_runner()); | 539 context->network_task_runner()); |
540 return new It2MeHost(context.Pass(), policy_watcher.Pass(), | 540 return new It2MeHost(context.Pass(), policy_watcher.Pass(), |
541 confirmation_dialog_factory.Pass(), | 541 confirmation_dialog_factory.Pass(), |
542 observer, xmpp_server_config, directory_bot_jid); | 542 observer, xmpp_server_config, directory_bot_jid); |
543 } | 543 } |
544 | 544 |
545 } // namespace remoting | 545 } // namespace remoting |
OLD | NEW |