OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/plugin/host_script_object.h" | 5 #include "remoting/host/plugin/host_script_object.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 base::Unretained(this)))); | 544 base::Unretained(this)))); |
545 | 545 |
546 // Beyond this point nothing can fail, so save the config and request. | 546 // Beyond this point nothing can fail, so save the config and request. |
547 signal_strategy_.reset(signal_strategy.release()); | 547 signal_strategy_.reset(signal_strategy.release()); |
548 register_request_.reset(register_request.release()); | 548 register_request_.reset(register_request.release()); |
549 | 549 |
550 // Create the Host. | 550 // Create the Host. |
551 LOG(INFO) << "NAT state: " << nat_traversal_enabled_; | 551 LOG(INFO) << "NAT state: " << nat_traversal_enabled_; |
552 host_ = new ChromotingHost( | 552 host_ = new ChromotingHost( |
553 host_context_.get(), signal_strategy_.get(), desktop_environment_.get(), | 553 host_context_.get(), signal_strategy_.get(), desktop_environment_.get(), |
554 NetworkSettings(nat_traversal_enabled_)); | 554 NetworkSettings(nat_traversal_enabled_ ? |
| 555 NetworkSettings::NAT_TRAVERSAL_ENABLED : |
| 556 NetworkSettings::NAT_TRAVERSAL_DISABLED)); |
555 host_->AddStatusObserver(this); | 557 host_->AddStatusObserver(this); |
556 log_to_server_.reset( | 558 log_to_server_.reset( |
557 new LogToServer(host_, ServerLogEntry::IT2ME, signal_strategy_.get())); | 559 new LogToServer(host_, ServerLogEntry::IT2ME, signal_strategy_.get())); |
558 it2me_host_user_interface_.reset( | 560 it2me_host_user_interface_.reset( |
559 new It2MeHostUserInterface(host_.get(), host_context_.get())); | 561 new It2MeHostUserInterface(host_.get(), host_context_.get())); |
560 it2me_host_user_interface_->Init(); | 562 it2me_host_user_interface_->Init(); |
561 | 563 |
562 { | 564 { |
563 base::AutoLock auto_lock(ui_strings_lock_); | 565 base::AutoLock auto_lock(ui_strings_lock_); |
564 host_->SetUiStrings(ui_strings_); | 566 host_->SetUiStrings(ui_strings_); |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 return is_good; | 1125 return is_good; |
1124 } | 1126 } |
1125 | 1127 |
1126 void HostNPScriptObject::SetException(const std::string& exception_string) { | 1128 void HostNPScriptObject::SetException(const std::string& exception_string) { |
1127 DCHECK(plugin_message_loop_proxy_->BelongsToCurrentThread()); | 1129 DCHECK(plugin_message_loop_proxy_->BelongsToCurrentThread()); |
1128 g_npnetscape_funcs->setexception(parent_, exception_string.c_str()); | 1130 g_npnetscape_funcs->setexception(parent_, exception_string.c_str()); |
1129 LOG(INFO) << exception_string; | 1131 LOG(INFO) << exception_string; |
1130 } | 1132 } |
1131 | 1133 |
1132 } // namespace remoting | 1134 } // namespace remoting |
OLD | NEW |