| 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. | 5 // This file implements a standalone host process for Me2Me. |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "remoting/host/host_exit_codes.h" | 51 #include "remoting/host/host_exit_codes.h" |
| 52 #include "remoting/host/host_main.h" | 52 #include "remoting/host/host_main.h" |
| 53 #include "remoting/host/ipc_constants.h" | 53 #include "remoting/host/ipc_constants.h" |
| 54 #include "remoting/host/ipc_desktop_environment.h" | 54 #include "remoting/host/ipc_desktop_environment.h" |
| 55 #include "remoting/host/ipc_host_event_logger.h" | 55 #include "remoting/host/ipc_host_event_logger.h" |
| 56 #include "remoting/host/json_host_config.h" | 56 #include "remoting/host/json_host_config.h" |
| 57 #include "remoting/host/log_to_server.h" | 57 #include "remoting/host/log_to_server.h" |
| 58 #include "remoting/host/logging.h" | 58 #include "remoting/host/logging.h" |
| 59 #include "remoting/host/me2me_desktop_environment.h" | 59 #include "remoting/host/me2me_desktop_environment.h" |
| 60 #include "remoting/host/network_settings.h" | 60 #include "remoting/host/network_settings.h" |
| 61 #include "remoting/host/pairing_registry_delegate.h" |
| 61 #include "remoting/host/policy_hack/policy_watcher.h" | 62 #include "remoting/host/policy_hack/policy_watcher.h" |
| 62 #include "remoting/host/service_urls.h" | 63 #include "remoting/host/service_urls.h" |
| 63 #include "remoting/host/session_manager_factory.h" | 64 #include "remoting/host/session_manager_factory.h" |
| 64 #include "remoting/host/signaling_connector.h" | 65 #include "remoting/host/signaling_connector.h" |
| 65 #include "remoting/host/token_validator_factory_impl.h" | 66 #include "remoting/host/token_validator_factory_impl.h" |
| 66 #include "remoting/host/ui_strings.h" | 67 #include "remoting/host/ui_strings.h" |
| 67 #include "remoting/host/usage_stats_consent.h" | 68 #include "remoting/host/usage_stats_consent.h" |
| 68 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 69 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
| 69 #include "remoting/protocol/me2me_host_authenticator_factory.h" | 70 #include "remoting/protocol/me2me_host_authenticator_factory.h" |
| 70 #include "remoting/protocol/pairing_registry.h" | 71 #include "remoting/protocol/pairing_registry.h" |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 | 472 |
| 472 std::string local_certificate = key_pair_->GenerateCertificate(); | 473 std::string local_certificate = key_pair_->GenerateCertificate(); |
| 473 if (local_certificate.empty()) { | 474 if (local_certificate.empty()) { |
| 474 LOG(ERROR) << "Failed to generate host certificate."; | 475 LOG(ERROR) << "Failed to generate host certificate."; |
| 475 ShutdownHost(kInitializationFailed); | 476 ShutdownHost(kInitializationFailed); |
| 476 return; | 477 return; |
| 477 } | 478 } |
| 478 | 479 |
| 479 // TODO(jamiewalch): Add a pairing registry here once all the code | 480 // TODO(jamiewalch): Add a pairing registry here once all the code |
| 480 // is committed. | 481 // is committed. |
| 481 scoped_refptr<remoting::protocol::PairingRegistry> pairing_registry; | 482 scoped_refptr<remoting::protocol::PairingRegistry> pairing_registry( |
| 482 //scoped_refptr<protocol::PairingRegistry> pairing_registry( | 483 new remoting::protocol::PairingRegistry( |
| 483 // new protocol::PairingRegistry( | 484 CreatePairingRegistryDelegate(NULL))); |
| 484 // scoped_ptr<protocol::PairingRegistry::Delegate>( | |
| 485 // new protocol::NotImplementedPairingRegistryDelegate), | |
| 486 // protocol::PairingRegistry::PairedClients())); | |
| 487 | 485 |
| 488 scoped_ptr<protocol::AuthenticatorFactory> factory; | 486 scoped_ptr<protocol::AuthenticatorFactory> factory; |
| 489 | 487 |
| 490 if (token_url_.is_empty() && token_validation_url_.is_empty()) { | 488 if (token_url_.is_empty() && token_validation_url_.is_empty()) { |
| 491 factory = protocol::Me2MeHostAuthenticatorFactory::CreateWithSharedSecret( | 489 factory = protocol::Me2MeHostAuthenticatorFactory::CreateWithSharedSecret( |
| 492 local_certificate, key_pair_, host_secret_hash_, pairing_registry); | 490 local_certificate, key_pair_, host_secret_hash_, pairing_registry); |
| 493 | 491 |
| 494 } else if (token_url_.is_valid() && token_validation_url_.is_valid()) { | 492 } else if (token_url_.is_valid() && token_validation_url_.is_valid()) { |
| 495 scoped_ptr<protocol::ThirdPartyHostAuthenticator::TokenValidatorFactory> | 493 scoped_ptr<protocol::ThirdPartyHostAuthenticator::TokenValidatorFactory> |
| 496 token_validator_factory(new TokenValidatorFactoryImpl( | 494 token_validator_factory(new TokenValidatorFactoryImpl( |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1101 return exit_code; | 1099 return exit_code; |
| 1102 } | 1100 } |
| 1103 | 1101 |
| 1104 } // namespace remoting | 1102 } // namespace remoting |
| 1105 | 1103 |
| 1106 #if !defined(OS_WIN) | 1104 #if !defined(OS_WIN) |
| 1107 int main(int argc, char** argv) { | 1105 int main(int argc, char** argv) { |
| 1108 return remoting::HostMain(argc, argv); | 1106 return remoting::HostMain(argc, argv); |
| 1109 } | 1107 } |
| 1110 #endif // !defined(OS_WIN) | 1108 #endif // !defined(OS_WIN) |
| OLD | NEW |