| 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 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 #endif | 851 #endif |
| 852 | 852 |
| 853 if (curtain_required_ != curtain_required) { | 853 if (curtain_required_ != curtain_required) { |
| 854 if (curtain_required) | 854 if (curtain_required) |
| 855 LOG(INFO) << "Policy requires curtain-mode."; | 855 LOG(INFO) << "Policy requires curtain-mode."; |
| 856 else | 856 else |
| 857 LOG(INFO) << "Policy does not require curtain-mode."; | 857 LOG(INFO) << "Policy does not require curtain-mode."; |
| 858 curtain_required_ = curtain_required; | 858 curtain_required_ = curtain_required; |
| 859 if (curtaining_host_observer_) | 859 if (curtaining_host_observer_) |
| 860 curtaining_host_observer_->SetEnableCurtaining(curtain_required_); | 860 curtaining_host_observer_->SetEnableCurtaining(curtain_required_); |
| 861 |
| 862 // The current Windows curtain mode implementation relies on this code |
| 863 // restarting the host when the curtain mode policy changes. For example if |
| 864 // the policy is enabled while someone is already connected to the console |
| 865 // that session should be either curtained or disconnected. This code makes |
| 866 // sure that the session will be disconnected by restarting the host. |
| 861 return true; | 867 return true; |
| 862 } | 868 } |
| 863 return false; | 869 return false; |
| 864 } | 870 } |
| 865 | 871 |
| 866 bool HostProcess::OnHostTalkGadgetPrefixPolicyUpdate( | 872 bool HostProcess::OnHostTalkGadgetPrefixPolicyUpdate( |
| 867 const std::string& talkgadget_prefix) { | 873 const std::string& talkgadget_prefix) { |
| 868 // Returns true if the host has to be restarted after this policy update. | 874 // Returns true if the host has to be restarted after this policy update. |
| 869 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); | 875 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); |
| 870 | 876 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 host_event_logger_.reset( | 953 host_event_logger_.reset( |
| 948 new IpcHostEventLogger(host_->AsWeakPtr(), daemon_channel_.get())); | 954 new IpcHostEventLogger(host_->AsWeakPtr(), daemon_channel_.get())); |
| 949 #else // !defined(REMOTING_MULTI_PROCESS) | 955 #else // !defined(REMOTING_MULTI_PROCESS) |
| 950 host_event_logger_ = | 956 host_event_logger_ = |
| 951 HostEventLogger::Create(host_->AsWeakPtr(), kApplicationName); | 957 HostEventLogger::Create(host_->AsWeakPtr(), kApplicationName); |
| 952 #endif // !defined(REMOTING_MULTI_PROCESS) | 958 #endif // !defined(REMOTING_MULTI_PROCESS) |
| 953 | 959 |
| 954 resizing_host_observer_.reset( | 960 resizing_host_observer_.reset( |
| 955 new ResizingHostObserver(desktop_resizer_.get(), host_->AsWeakPtr())); | 961 new ResizingHostObserver(desktop_resizer_.get(), host_->AsWeakPtr())); |
| 956 | 962 |
| 963 #if defined(REMOTING_RDP_SESSION) |
| 964 // TODO(alexeypa): do not create |curtain_| in this case. |
| 965 CurtainMode* curtain = static_cast<IpcDesktopEnvironmentFactory*>( |
| 966 desktop_environment_factory_.get()); |
| 967 #else // !defined(REMOTING_RDP_SESSION) |
| 968 CurtainMode* curtain = curtain_.get(); |
| 969 #endif // !defined(REMOTING_RDP_SESSION) |
| 970 |
| 957 // Create a host observer to enable/disable curtain mode as clients connect | 971 // Create a host observer to enable/disable curtain mode as clients connect |
| 958 // and disconnect. | 972 // and disconnect. |
| 959 curtaining_host_observer_.reset(new CurtainingHostObserver( | 973 curtaining_host_observer_.reset(new CurtainingHostObserver( |
| 960 curtain_.get(), host_->AsWeakPtr())); | 974 curtain, host_->AsWeakPtr())); |
| 961 curtaining_host_observer_->SetEnableCurtaining(curtain_required_); | 975 curtaining_host_observer_->SetEnableCurtaining(curtain_required_); |
| 962 | 976 |
| 963 if (host_user_interface_.get()) { | 977 if (host_user_interface_.get()) { |
| 964 host_user_interface_->Start( | 978 host_user_interface_->Start( |
| 965 host_, base::Bind(&HostProcess::OnDisconnectRequested, this)); | 979 host_, base::Bind(&HostProcess::OnDisconnectRequested, this)); |
| 966 } | 980 } |
| 967 | 981 |
| 968 host_->Start(xmpp_login_); | 982 host_->Start(xmpp_login_); |
| 969 | 983 |
| 970 CreateAuthenticatorFactory(); | 984 CreateAuthenticatorFactory(); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1112 return exit_code; | 1126 return exit_code; |
| 1113 } | 1127 } |
| 1114 | 1128 |
| 1115 } // namespace remoting | 1129 } // namespace remoting |
| 1116 | 1130 |
| 1117 #if !defined(OS_WIN) | 1131 #if !defined(OS_WIN) |
| 1118 int main(int argc, char** argv) { | 1132 int main(int argc, char** argv) { |
| 1119 return remoting::HostMain(argc, argv); | 1133 return remoting::HostMain(argc, argv); |
| 1120 } | 1134 } |
| 1121 #endif // !defined(OS_WIN) | 1135 #endif // !defined(OS_WIN) |
| OLD | NEW |