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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 #include "remoting/host/ipc_constants.h" | 55 #include "remoting/host/ipc_constants.h" |
56 #include "remoting/host/ipc_desktop_environment.h" | 56 #include "remoting/host/ipc_desktop_environment.h" |
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/network_settings.h" | 60 #include "remoting/host/network_settings.h" |
61 #include "remoting/host/policy_hack/policy_watcher.h" | 61 #include "remoting/host/policy_hack/policy_watcher.h" |
62 #include "remoting/host/resizing_host_observer.h" | 62 #include "remoting/host/resizing_host_observer.h" |
63 #include "remoting/host/session_manager_factory.h" | 63 #include "remoting/host/session_manager_factory.h" |
64 #include "remoting/host/signaling_connector.h" | 64 #include "remoting/host/signaling_connector.h" |
| 65 #include "remoting/host/ui_strings.h" |
65 #include "remoting/host/usage_stats_consent.h" | 66 #include "remoting/host/usage_stats_consent.h" |
66 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 67 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
67 #include "remoting/protocol/me2me_host_authenticator_factory.h" | 68 #include "remoting/protocol/me2me_host_authenticator_factory.h" |
68 | 69 |
69 #if defined(OS_POSIX) | 70 #if defined(OS_POSIX) |
70 #include <pwd.h> | 71 #include <pwd.h> |
71 #include <signal.h> | 72 #include <signal.h> |
72 #include "base/file_descriptor_posix.h" | 73 #include "base/file_descriptor_posix.h" |
73 #include "remoting/host/pam_authorization_factory_posix.h" | 74 #include "remoting/host/pam_authorization_factory_posix.h" |
74 #include "remoting/host/posix/signal_handler.h" | 75 #include "remoting/host/posix/signal_handler.h" |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 // is rejected by the Window Server on OS X 10.7.4, and prevents the | 596 // is rejected by the Window Server on OS X 10.7.4, and prevents the |
596 // capturer from working (http://crbug.com/140984). | 597 // capturer from working (http://crbug.com/140984). |
597 | 598 |
598 // TODO(lambroslambrou): Use a better technique of detecting whether we're | 599 // TODO(lambroslambrou): Use a better technique of detecting whether we're |
599 // running in the LoginWindow context, and refactor this into a separate | 600 // running in the LoginWindow context, and refactor this into a separate |
600 // function to be used here and in CurtainMode::ActivateCurtain(). | 601 // function to be used here and in CurtainMode::ActivateCurtain(). |
601 want_user_interface = getuid() != 0; | 602 want_user_interface = getuid() != 0; |
602 #endif // OS_MACOSX | 603 #endif // OS_MACOSX |
603 | 604 |
604 if (want_user_interface) { | 605 if (want_user_interface) { |
| 606 UiStrings ui_strings; |
605 host_user_interface_.reset( | 607 host_user_interface_.reset( |
606 new HostUserInterface(context_->network_task_runner(), | 608 new HostUserInterface(context_->network_task_runner(), |
607 context_->ui_task_runner())); | 609 context_->ui_task_runner(), ui_strings)); |
608 host_user_interface_->Init(); | 610 host_user_interface_->Init(); |
609 } | 611 } |
610 | 612 |
611 context_->network_task_runner()->PostTask( | 613 context_->network_task_runner()->PostTask( |
612 FROM_HERE, | 614 FROM_HERE, |
613 base::Bind(&HostProcess::StartOnNetworkThread, this)); | 615 base::Bind(&HostProcess::StartOnNetworkThread, this)); |
614 } | 616 } |
615 | 617 |
616 void HostProcess::SendSasToConsole() { | 618 void HostProcess::SendSasToConsole() { |
617 DCHECK(context_->ui_task_runner()->BelongsToCurrentThread()); | 619 DCHECK(context_->ui_task_runner()->BelongsToCurrentThread()); |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 user32.GetFunctionPointer("SetProcessDPIAware")); | 1139 user32.GetFunctionPointer("SetProcessDPIAware")); |
1138 set_process_dpi_aware(); | 1140 set_process_dpi_aware(); |
1139 } | 1141 } |
1140 | 1142 |
1141 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting | 1143 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting |
1142 // the command line from GetCommandLineW(), so we can safely pass NULL here. | 1144 // the command line from GetCommandLineW(), so we can safely pass NULL here. |
1143 return main(0, NULL); | 1145 return main(0, NULL); |
1144 } | 1146 } |
1145 | 1147 |
1146 #endif // defined(OS_WIN) | 1148 #endif // defined(OS_WIN) |
OLD | NEW |