| 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 27 matching lines...) Expand all Loading... |
| 38 #include "remoting/host/chromoting_host_context.h" | 38 #include "remoting/host/chromoting_host_context.h" |
| 39 #include "remoting/host/constants.h" | 39 #include "remoting/host/constants.h" |
| 40 #include "remoting/host/desktop_environment.h" | 40 #include "remoting/host/desktop_environment.h" |
| 41 #include "remoting/host/event_executor.h" | 41 #include "remoting/host/event_executor.h" |
| 42 #include "remoting/host/heartbeat_sender.h" | 42 #include "remoting/host/heartbeat_sender.h" |
| 43 #include "remoting/host/host_key_pair.h" | 43 #include "remoting/host/host_key_pair.h" |
| 44 #include "remoting/host/host_secret.h" | 44 #include "remoting/host/host_secret.h" |
| 45 #include "remoting/host/it2me_host_user_interface.h" | 45 #include "remoting/host/it2me_host_user_interface.h" |
| 46 #include "remoting/host/json_host_config.h" | 46 #include "remoting/host/json_host_config.h" |
| 47 #include "remoting/host/log_to_server.h" | 47 #include "remoting/host/log_to_server.h" |
| 48 #include "remoting/host/network_settings.h" |
| 48 #include "remoting/host/register_support_host_request.h" | 49 #include "remoting/host/register_support_host_request.h" |
| 50 #include "remoting/host/session_manager_factory.h" |
| 49 #include "remoting/host/signaling_connector.h" | 51 #include "remoting/host/signaling_connector.h" |
| 50 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 52 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
| 51 #include "remoting/proto/video.pb.h" | 53 #include "remoting/proto/video.pb.h" |
| 52 #include "remoting/protocol/it2me_host_authenticator_factory.h" | 54 #include "remoting/protocol/it2me_host_authenticator_factory.h" |
| 53 #include "remoting/protocol/me2me_host_authenticator_factory.h" | 55 #include "remoting/protocol/me2me_host_authenticator_factory.h" |
| 54 | 56 |
| 55 #if defined(TOOLKIT_GTK) | 57 #if defined(TOOLKIT_GTK) |
| 56 #include "ui/gfx/gtk_util.h" | 58 #include "ui/gfx/gtk_util.h" |
| 57 #elif defined(OS_MACOSX) | 59 #elif defined(OS_MACOSX) |
| 58 #include "base/mac/scoped_nsautorelease_pool.h" | 60 #include "base/mac/scoped_nsautorelease_pool.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 scoped_ptr<Capturer> capturer(new CapturerFake()); | 227 scoped_ptr<Capturer> capturer(new CapturerFake()); |
| 226 scoped_ptr<EventExecutor> event_executor = EventExecutor::Create( | 228 scoped_ptr<EventExecutor> event_executor = EventExecutor::Create( |
| 227 context_.desktop_message_loop()->message_loop_proxy(), | 229 context_.desktop_message_loop()->message_loop_proxy(), |
| 228 context_.ui_message_loop(), capturer.get()); | 230 context_.ui_message_loop(), capturer.get()); |
| 229 desktop_environment_ = DesktopEnvironment::CreateFake( | 231 desktop_environment_ = DesktopEnvironment::CreateFake( |
| 230 &context_, capturer.Pass(), event_executor.Pass()); | 232 &context_, capturer.Pass(), event_executor.Pass()); |
| 231 } else { | 233 } else { |
| 232 desktop_environment_ = DesktopEnvironment::Create(&context_); | 234 desktop_environment_ = DesktopEnvironment::Create(&context_); |
| 233 } | 235 } |
| 234 | 236 |
| 235 host_ = new ChromotingHost(&context_, signal_strategy_.get(), | 237 host_ = new ChromotingHost( |
| 236 desktop_environment_.get(), network_settings_); | 238 &context_, signal_strategy_.get(), desktop_environment_.get(), |
| 239 CreateHostSessionManager(network_settings_, |
| 240 context_.url_request_context_getter())); |
| 237 | 241 |
| 238 ServerLogEntry::Mode mode = | 242 ServerLogEntry::Mode mode = |
| 239 is_it2me_ ? ServerLogEntry::IT2ME : ServerLogEntry::ME2ME; | 243 is_it2me_ ? ServerLogEntry::IT2ME : ServerLogEntry::ME2ME; |
| 240 log_to_server_.reset(new LogToServer(host_, mode, signal_strategy_.get())); | 244 log_to_server_.reset(new LogToServer(host_, mode, signal_strategy_.get())); |
| 241 | 245 |
| 242 if (is_it2me_) { | 246 if (is_it2me_) { |
| 243 it2me_host_user_interface_.reset(new It2MeHostUserInterface(&context_)); | 247 it2me_host_user_interface_.reset(new It2MeHostUserInterface(&context_)); |
| 244 it2me_host_user_interface_->Start( | 248 it2me_host_user_interface_->Start( |
| 245 host_, | 249 host_, |
| 246 base::Bind(&ChromotingHost::Shutdown, host_, base::Closure())); | 250 base::Bind(&ChromotingHost::Shutdown, host_, base::Closure())); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 max_port < 0 || max_port > 65535) { | 415 max_port < 0 || max_port > 65535) { |
| 412 LOG(ERROR) << "Invalid max-port value: " << max_port | 416 LOG(ERROR) << "Invalid max-port value: " << max_port |
| 413 << ". Expected integer in range [0, 65535]."; | 417 << ". Expected integer in range [0, 65535]."; |
| 414 return 1; | 418 return 1; |
| 415 } | 419 } |
| 416 simple_host.network_settings()->max_port = max_port; | 420 simple_host.network_settings()->max_port = max_port; |
| 417 } | 421 } |
| 418 | 422 |
| 419 return simple_host.Run(); | 423 return simple_host.Run(); |
| 420 } | 424 } |
| OLD | NEW |