| 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 29 matching lines...) Expand all Loading... |
| 40 #include "remoting/host/host_key_pair.h" | 40 #include "remoting/host/host_key_pair.h" |
| 41 #include "remoting/host/host_secret.h" | 41 #include "remoting/host/host_secret.h" |
| 42 #include "remoting/host/it2me_host_user_interface.h" | 42 #include "remoting/host/it2me_host_user_interface.h" |
| 43 #include "remoting/host/json_host_config.h" | 43 #include "remoting/host/json_host_config.h" |
| 44 #include "remoting/host/log_to_server.h" | 44 #include "remoting/host/log_to_server.h" |
| 45 #include "remoting/host/register_support_host_request.h" | 45 #include "remoting/host/register_support_host_request.h" |
| 46 #include "remoting/host/signaling_connector.h" | 46 #include "remoting/host/signaling_connector.h" |
| 47 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 47 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
| 48 #include "remoting/proto/video.pb.h" | 48 #include "remoting/proto/video.pb.h" |
| 49 #include "remoting/protocol/it2me_host_authenticator_factory.h" | 49 #include "remoting/protocol/it2me_host_authenticator_factory.h" |
| 50 #include "remoting/protocol/v1_authenticator.h" | 50 #include "remoting/protocol/me2me_host_authenticator_factory.h" |
| 51 | 51 |
| 52 #if defined(TOOLKIT_USES_GTK) | 52 #if defined(TOOLKIT_USES_GTK) |
| 53 #include "ui/gfx/gtk_util.h" | 53 #include "ui/gfx/gtk_util.h" |
| 54 #elif defined(OS_MACOSX) | 54 #elif defined(OS_MACOSX) |
| 55 #include "base/mac/scoped_nsautorelease_pool.h" | 55 #include "base/mac/scoped_nsautorelease_pool.h" |
| 56 #elif defined(OS_WIN) | 56 #elif defined(OS_WIN) |
| 57 // TODO(garykac) Make simple host into a proper GUI app on Windows so that we | 57 // TODO(garykac) Make simple host into a proper GUI app on Windows so that we |
| 58 // have an hModule for the dialog resource. | 58 // have an hModule for the dialog resource. |
| 59 HMODULE g_hModule = NULL; | 59 HMODULE g_hModule = NULL; |
| 60 #endif | 60 #endif |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 register_request_.reset(new RegisterSupportHostRequest( | 228 register_request_.reset(new RegisterSupportHostRequest( |
| 229 signal_strategy_.get(), &key_pair_, | 229 signal_strategy_.get(), &key_pair_, |
| 230 base::Bind(&SimpleHost::SetIT2MeAccessCode, host_, &key_pair_))); | 230 base::Bind(&SimpleHost::SetIT2MeAccessCode, host_, &key_pair_))); |
| 231 } else { | 231 } else { |
| 232 heartbeat_sender_.reset( | 232 heartbeat_sender_.reset( |
| 233 new HeartbeatSender(host_id_, signal_strategy_.get(), &key_pair_)); | 233 new HeartbeatSender(host_id_, signal_strategy_.get(), &key_pair_)); |
| 234 } | 234 } |
| 235 | 235 |
| 236 host_->Start(); | 236 host_->Start(); |
| 237 | 237 |
| 238 // Set an empty shared-secret for Me2Me. | 238 // Create a Me2Me authenticator factory. |
| 239 // TODO(sergeyu): This is a temporary hack pending us adding a way | 239 // |
| 240 // to set a PIN. crbug.com/105214 . | 240 // TODO(sergeyu): Currently empty PIN is used. This is a temporary |
| 241 // hack pending us adding a way to set a PIN. crbug.com/105214 . |
| 241 if (!is_it2me_) { | 242 if (!is_it2me_) { |
| 242 scoped_ptr<protocol::AuthenticatorFactory> factory( | 243 scoped_ptr<protocol::AuthenticatorFactory> factory( |
| 243 new protocol::V1HostAuthenticatorFactory( | 244 new protocol::Me2MeHostAuthenticatorFactory( |
| 244 key_pair_.GenerateCertificate(), key_pair_.private_key(), "")); | 245 xmpp_login_, key_pair_.GenerateCertificate(), |
| 246 key_pair_.private_key(), "")); |
| 245 host_->SetAuthenticatorFactory(factory.Pass()); | 247 host_->SetAuthenticatorFactory(factory.Pass()); |
| 246 } | 248 } |
| 247 } | 249 } |
| 248 | 250 |
| 249 MessageLoop message_loop_; | 251 MessageLoop message_loop_; |
| 250 base::Thread file_io_thread_; | 252 base::Thread file_io_thread_; |
| 251 ChromotingHostContext context_; | 253 ChromotingHostContext context_; |
| 252 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; | 254 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; |
| 253 | 255 |
| 254 FilePath config_path_; | 256 FilePath config_path_; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 LOG(ERROR) << "Unknown video codec: " << video_codec; | 323 LOG(ERROR) << "Unknown video codec: " << video_codec; |
| 322 return 1; | 324 return 1; |
| 323 } | 325 } |
| 324 config->mutable_video_configs()->push_back(ChannelConfig( | 326 config->mutable_video_configs()->push_back(ChannelConfig( |
| 325 transport, remoting::protocol::kDefaultStreamVersion, codec)); | 327 transport, remoting::protocol::kDefaultStreamVersion, codec)); |
| 326 simple_host.set_protocol_config(config.release()); | 328 simple_host.set_protocol_config(config.release()); |
| 327 } | 329 } |
| 328 | 330 |
| 329 return simple_host.Run(); | 331 return simple_host.Run(); |
| 330 } | 332 } |
| OLD | NEW |