| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 #include "remoting/host/json_host_config.h" | 57 #include "remoting/host/json_host_config.h" |
| 58 #include "remoting/host/log_to_server.h" | 58 #include "remoting/host/log_to_server.h" |
| 59 #include "remoting/host/logging.h" | 59 #include "remoting/host/logging.h" |
| 60 #include "remoting/host/me2me_desktop_environment.h" | 60 #include "remoting/host/me2me_desktop_environment.h" |
| 61 #include "remoting/host/pairing_registry_delegate.h" | 61 #include "remoting/host/pairing_registry_delegate.h" |
| 62 #include "remoting/host/policy_hack/policy_watcher.h" | 62 #include "remoting/host/policy_hack/policy_watcher.h" |
| 63 #include "remoting/host/service_urls.h" | 63 #include "remoting/host/service_urls.h" |
| 64 #include "remoting/host/session_manager_factory.h" | 64 #include "remoting/host/session_manager_factory.h" |
| 65 #include "remoting/host/signaling_connector.h" | 65 #include "remoting/host/signaling_connector.h" |
| 66 #include "remoting/host/token_validator_factory_impl.h" | 66 #include "remoting/host/token_validator_factory_impl.h" |
| 67 #include "remoting/host/ui_strings.h" | |
| 68 #include "remoting/host/usage_stats_consent.h" | 67 #include "remoting/host/usage_stats_consent.h" |
| 69 #include "remoting/jingle_glue/network_settings.h" | 68 #include "remoting/jingle_glue/network_settings.h" |
| 70 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 69 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
| 71 #include "remoting/protocol/me2me_host_authenticator_factory.h" | 70 #include "remoting/protocol/me2me_host_authenticator_factory.h" |
| 72 #include "remoting/protocol/pairing_registry.h" | 71 #include "remoting/protocol/pairing_registry.h" |
| 73 | 72 |
| 74 #if defined(OS_POSIX) | 73 #if defined(OS_POSIX) |
| 75 #include <signal.h> | 74 #include <signal.h> |
| 76 #include <sys/types.h> | 75 #include <sys/types.h> |
| 77 #include <unistd.h> | 76 #include <unistd.h> |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 // If an audio pipe is specific on the command-line then initialize | 573 // If an audio pipe is specific on the command-line then initialize |
| 575 // AudioCapturerLinux to capture from it. | 574 // AudioCapturerLinux to capture from it. |
| 576 base::FilePath audio_pipe_name = CommandLine::ForCurrentProcess()-> | 575 base::FilePath audio_pipe_name = CommandLine::ForCurrentProcess()-> |
| 577 GetSwitchValuePath(kAudioPipeSwitchName); | 576 GetSwitchValuePath(kAudioPipeSwitchName); |
| 578 if (!audio_pipe_name.empty()) { | 577 if (!audio_pipe_name.empty()) { |
| 579 remoting::AudioCapturerLinux::InitializePipeReader( | 578 remoting::AudioCapturerLinux::InitializePipeReader( |
| 580 context_->audio_task_runner(), audio_pipe_name); | 579 context_->audio_task_runner(), audio_pipe_name); |
| 581 } | 580 } |
| 582 #endif // defined(OS_LINUX) | 581 #endif // defined(OS_LINUX) |
| 583 | 582 |
| 584 // TODO(alexeypa): Localize the UI strings. See http://crbug.com/155204. | |
| 585 UiStrings ui_strings; | |
| 586 | |
| 587 // Create a desktop environment factory appropriate to the build type & | 583 // Create a desktop environment factory appropriate to the build type & |
| 588 // platform. | 584 // platform. |
| 589 #if defined(OS_WIN) | 585 #if defined(OS_WIN) |
| 590 IpcDesktopEnvironmentFactory* desktop_environment_factory = | 586 IpcDesktopEnvironmentFactory* desktop_environment_factory = |
| 591 new IpcDesktopEnvironmentFactory( | 587 new IpcDesktopEnvironmentFactory( |
| 592 context_->audio_task_runner(), | 588 context_->audio_task_runner(), |
| 593 context_->network_task_runner(), | 589 context_->network_task_runner(), |
| 594 context_->video_capture_task_runner(), | 590 context_->video_capture_task_runner(), |
| 595 context_->network_task_runner(), | 591 context_->network_task_runner(), |
| 596 daemon_channel_.get()); | 592 daemon_channel_.get()); |
| 597 desktop_session_connector_ = desktop_environment_factory; | 593 desktop_session_connector_ = desktop_environment_factory; |
| 598 #else // !defined(OS_WIN) | 594 #else // !defined(OS_WIN) |
| 599 DesktopEnvironmentFactory* desktop_environment_factory = | 595 DesktopEnvironmentFactory* desktop_environment_factory = |
| 600 new Me2MeDesktopEnvironmentFactory( | 596 new Me2MeDesktopEnvironmentFactory( |
| 601 context_->network_task_runner(), | 597 context_->network_task_runner(), |
| 602 context_->input_task_runner(), | 598 context_->input_task_runner(), |
| 603 context_->ui_task_runner(), | 599 context_->ui_task_runner()); |
| 604 ui_strings); | |
| 605 #endif // !defined(OS_WIN) | 600 #endif // !defined(OS_WIN) |
| 606 | 601 |
| 607 desktop_environment_factory_.reset(desktop_environment_factory); | 602 desktop_environment_factory_.reset(desktop_environment_factory); |
| 608 | 603 |
| 609 context_->network_task_runner()->PostTask( | 604 context_->network_task_runner()->PostTask( |
| 610 FROM_HERE, | 605 FROM_HERE, |
| 611 base::Bind(&HostProcess::StartOnNetworkThread, this)); | 606 base::Bind(&HostProcess::StartOnNetworkThread, this)); |
| 612 } | 607 } |
| 613 | 608 |
| 614 void HostProcess::ShutdownOnUiThread() { | 609 void HostProcess::ShutdownOnUiThread() { |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1119 return exit_code; | 1114 return exit_code; |
| 1120 } | 1115 } |
| 1121 | 1116 |
| 1122 } // namespace remoting | 1117 } // namespace remoting |
| 1123 | 1118 |
| 1124 #if !defined(OS_WIN) | 1119 #if !defined(OS_WIN) |
| 1125 int main(int argc, char** argv) { | 1120 int main(int argc, char** argv) { |
| 1126 return remoting::HostMain(argc, argv); | 1121 return remoting::HostMain(argc, argv); |
| 1127 } | 1122 } |
| 1128 #endif // !defined(OS_WIN) | 1123 #endif // !defined(OS_WIN) |
| OLD | NEW |