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 // This is an application of a minimal host process in a Chromoting | 5 // This is an application of a minimal host process in a Chromoting |
6 // system. It serves the purpose of gluing different pieces together | 6 // system. It serves the purpose of gluing different pieces together |
7 // to make a functional host process for testing. | 7 // to make a functional host process for testing. |
8 // | 8 // |
9 // It peforms the following functionality: | 9 // It peforms the following functionality: |
10 // 1. Connect to the GTalk network and register the machine as a host. | 10 // 1. Connect to the GTalk network and register the machine as a host. |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 } | 228 } |
229 | 229 |
230 host_ = new ChromotingHost(&context_, signal_strategy_.get(), | 230 host_ = new ChromotingHost(&context_, signal_strategy_.get(), |
231 desktop_environment_.get(), network_settings_); | 231 desktop_environment_.get(), network_settings_); |
232 | 232 |
233 ServerLogEntry::Mode mode = | 233 ServerLogEntry::Mode mode = |
234 is_it2me_ ? ServerLogEntry::IT2ME : ServerLogEntry::ME2ME; | 234 is_it2me_ ? ServerLogEntry::IT2ME : ServerLogEntry::ME2ME; |
235 log_to_server_.reset(new LogToServer(host_, mode, signal_strategy_.get())); | 235 log_to_server_.reset(new LogToServer(host_, mode, signal_strategy_.get())); |
236 | 236 |
237 if (is_it2me_) { | 237 if (is_it2me_) { |
238 it2me_host_user_interface_.reset( | 238 it2me_host_user_interface_.reset(new It2MeHostUserInterface(&context_)); |
239 new It2MeHostUserInterface(host_, &context_)); | 239 it2me_host_user_interface_->Start( |
240 it2me_host_user_interface_->Init(); | 240 host_, |
| 241 base::Bind(&ChromotingHost::Shutdown, host_, base::Closure())); |
241 } | 242 } |
242 | 243 |
243 if (protocol_config_.get()) { | 244 if (protocol_config_.get()) { |
244 host_->set_protocol_config(protocol_config_.release()); | 245 host_->set_protocol_config(protocol_config_.release()); |
245 } | 246 } |
246 | 247 |
247 if (is_it2me_) { | 248 if (is_it2me_) { |
248 register_request_.reset(new RegisterSupportHostRequest( | 249 register_request_.reset(new RegisterSupportHostRequest( |
249 signal_strategy_.get(), &key_pair_, | 250 signal_strategy_.get(), &key_pair_, |
250 base::Bind(&SimpleHost::SetIT2MeAccessCode, host_, &key_pair_))); | 251 base::Bind(&SimpleHost::SetIT2MeAccessCode, host_, &key_pair_))); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 max_port < 0 || max_port > 65535) { | 377 max_port < 0 || max_port > 65535) { |
377 LOG(ERROR) << "Invalid max-port value: " << max_port | 378 LOG(ERROR) << "Invalid max-port value: " << max_port |
378 << ". Expected integer in range [0, 65535]."; | 379 << ". Expected integer in range [0, 65535]."; |
379 return 1; | 380 return 1; |
380 } | 381 } |
381 simple_host.network_settings()->max_port = max_port; | 382 simple_host.network_settings()->max_port = max_port; |
382 } | 383 } |
383 | 384 |
384 return simple_host.Run(); | 385 return simple_host.Run(); |
385 } | 386 } |
OLD | NEW |