| 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 file implements a standalone host process for Me2Me, which is currently | 5 // This file implements a standalone host process for Me2Me, which is currently |
| 6 // used for the Linux-only Virtual Me2Me build. | 6 // used for the Linux-only Virtual Me2Me build. |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "remoting/host/capturer.h" | 23 #include "remoting/host/capturer.h" |
| 24 #include "remoting/host/chromoting_host.h" | 24 #include "remoting/host/chromoting_host.h" |
| 25 #include "remoting/host/chromoting_host_context.h" | 25 #include "remoting/host/chromoting_host_context.h" |
| 26 #include "remoting/host/desktop_environment.h" | 26 #include "remoting/host/desktop_environment.h" |
| 27 #include "remoting/host/event_executor.h" | 27 #include "remoting/host/event_executor.h" |
| 28 #include "remoting/host/heartbeat_sender.h" | 28 #include "remoting/host/heartbeat_sender.h" |
| 29 #include "remoting/host/host_config.h" | 29 #include "remoting/host/host_config.h" |
| 30 #include "remoting/host/json_host_config.h" | 30 #include "remoting/host/json_host_config.h" |
| 31 #include "remoting/host/signaling_connector.h" | 31 #include "remoting/host/signaling_connector.h" |
| 32 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 32 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
| 33 #include "remoting/protocol/v1_authenticator.h" | 33 #include "remoting/protocol/me2me_host_authenticator_factory.h" |
| 34 | 34 |
| 35 #if defined(TOOLKIT_USES_GTK) | 35 #if defined(TOOLKIT_USES_GTK) |
| 36 #include "ui/gfx/gtk_util.h" | 36 #include "ui/gfx/gtk_util.h" |
| 37 #endif | 37 #endif |
| 38 | 38 |
| 39 namespace { | 39 namespace { |
| 40 // These are used for parsing the config-file locations from the command line, | 40 // These are used for parsing the config-file locations from the command line, |
| 41 // and for defining the default locations if the switches are not present. | 41 // and for defining the default locations if the switches are not present. |
| 42 const char kAuthConfigSwitchName[] = "auth-config"; | 42 const char kAuthConfigSwitchName[] = "auth-config"; |
| 43 const char kHostConfigSwitchName[] = "host-config"; | 43 const char kHostConfigSwitchName[] = "host-config"; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 desktop_environment_.reset(DesktopEnvironment::Create(&context_)); | 154 desktop_environment_.reset(DesktopEnvironment::Create(&context_)); |
| 155 | 155 |
| 156 host_ = new ChromotingHost( | 156 host_ = new ChromotingHost( |
| 157 &context_, signal_strategy_.get(), desktop_environment_.get(), false); | 157 &context_, signal_strategy_.get(), desktop_environment_.get(), false); |
| 158 | 158 |
| 159 heartbeat_sender_.reset( | 159 heartbeat_sender_.reset( |
| 160 new HeartbeatSender(host_id_, signal_strategy_.get(), &key_pair_)); | 160 new HeartbeatSender(host_id_, signal_strategy_.get(), &key_pair_)); |
| 161 | 161 |
| 162 host_->Start(); | 162 host_->Start(); |
| 163 | 163 |
| 164 // Set an empty shared-secret for Me2Me. | 164 // Create authenticator factory. |
| 165 | 165 // |
| 166 // TODO(sergeyu): This is a temporary hack pending us adding a way | 166 // TODO(sergeyu): Currently empty PIN is used. This is a temporary |
| 167 // to set a PIN. crbug.com/105214 . | 167 // hack pending us adding a way to set a PIN. crbug.com/105214 . |
| 168 scoped_ptr<protocol::AuthenticatorFactory> factory( | 168 scoped_ptr<protocol::AuthenticatorFactory> factory( |
| 169 new protocol::V1HostAuthenticatorFactory( | 169 new protocol::Me2MeHostAuthenticatorFactory( |
| 170 key_pair_.GenerateCertificate(), key_pair_.private_key(), "")); | 170 xmpp_login_, key_pair_.GenerateCertificate(), |
| 171 key_pair_.private_key(), "")); |
| 171 host_->SetAuthenticatorFactory(factory.Pass()); | 172 host_->SetAuthenticatorFactory(factory.Pass()); |
| 172 } | 173 } |
| 173 | 174 |
| 174 MessageLoop message_loop_; | 175 MessageLoop message_loop_; |
| 175 base::Thread file_io_thread_; | 176 base::Thread file_io_thread_; |
| 176 remoting::ChromotingHostContext context_; | 177 remoting::ChromotingHostContext context_; |
| 177 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; | 178 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; |
| 178 | 179 |
| 179 FilePath auth_config_path_; | 180 FilePath auth_config_path_; |
| 180 FilePath host_config_path_; | 181 FilePath host_config_path_; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 208 // Continue windows, though these should not be used for the Me2Me case | 209 // Continue windows, though these should not be used for the Me2Me case |
| 209 // (crbug.com/104377). | 210 // (crbug.com/104377). |
| 210 gfx::GtkInitFromCommandLine(*cmd_line); | 211 gfx::GtkInitFromCommandLine(*cmd_line); |
| 211 #endif // TOOLKIT_USES_GTK | 212 #endif // TOOLKIT_USES_GTK |
| 212 | 213 |
| 213 remoting::HostProcess me2me_host; | 214 remoting::HostProcess me2me_host; |
| 214 me2me_host.InitWithCommandLine(cmd_line); | 215 me2me_host.InitWithCommandLine(cmd_line); |
| 215 | 216 |
| 216 return me2me_host.Run(); | 217 return me2me_host.Run(); |
| 217 } | 218 } |
| OLD | NEW |