diff options
author | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-05 07:47:18 +0000 |
---|---|---|
committer | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-05 07:47:18 +0000 |
commit | 618022060ccfe230673570a7b9685dd5cea7343d (patch) | |
tree | 91f54a0c9bef9c502b143bddb40b6d67cbcd8c17 /remoting | |
parent | 4c084c6e4f1436da12732f9df9a68b7db9759efd (diff) | |
download | chromium_src-618022060ccfe230673570a7b9685dd5cea7343d.zip chromium_src-618022060ccfe230673570a7b9685dd5cea7343d.tar.gz chromium_src-618022060ccfe230673570a7b9685dd5cea7343d.tar.bz2 |
Pass the |curtain_activated| flag to IpcDesktopEnvironmentFactory.
In the case of the multi-process host the ability to support curtain mode is a property of the desktop environment representing the screen. This CL hooks up IpcDesktopEnvironmentFactory to receive the request to activate the curtain. This way the factory class will be able to create a different kind of the desktop environment if the curtain was requested.
Other changes:
- Added remoting_rdp_session% GYP flag that enables RDP integration on Windows.
BUG=137696
Review URL: https://chromiumcodereview.appspot.com/12379084
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186129 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/host/client_session.cc | 2 | ||||
-rw-r--r-- | remoting/host/ipc_desktop_environment.cc | 12 | ||||
-rw-r--r-- | remoting/host/ipc_desktop_environment.h | 13 | ||||
-rw-r--r-- | remoting/host/remoting_me2me_host.cc | 16 | ||||
-rw-r--r-- | remoting/remoting.gyp | 7 |
5 files changed, 45 insertions, 5 deletions
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc index fd289cb..46bb5c5 100644 --- a/remoting/host/client_session.cc +++ b/remoting/host/client_session.cc @@ -47,6 +47,8 @@ ClientSession::ClientSession( connection_(connection.Pass()), connection_factory_(connection_.get()), client_jid_(connection_->session()->jid()), + // TODO(alexeypa): delay creation of |desktop_environment_| until + // the curtain is enabled. desktop_environment_(desktop_environment_factory->Create( client_jid_, base::Bind(&protocol::ConnectionToClient::Disconnect, diff --git a/remoting/host/ipc_desktop_environment.cc b/remoting/host/ipc_desktop_environment.cc index cccb66a..0db3cfd 100644 --- a/remoting/host/ipc_desktop_environment.cc +++ b/remoting/host/ipc_desktop_environment.cc @@ -25,7 +25,8 @@ IpcDesktopEnvironment::IpcDesktopEnvironment( scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, const std::string& client_jid, const base::Closure& disconnect_callback, - base::WeakPtr<DesktopSessionConnector> desktop_session_connector) + base::WeakPtr<DesktopSessionConnector> desktop_session_connector, + bool curtain_required) : caller_task_runner_(caller_task_runner), connected_(false), desktop_session_connector_(desktop_session_connector), @@ -86,6 +87,7 @@ IpcDesktopEnvironmentFactory::IpcDesktopEnvironmentFactory( IPC::Sender* daemon_channel) : caller_task_runner_(caller_task_runner), io_task_runner_(io_task_runner), + curtain_activated_(false), daemon_channel_(daemon_channel), connector_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), next_id_(0) { @@ -94,6 +96,12 @@ IpcDesktopEnvironmentFactory::IpcDesktopEnvironmentFactory( IpcDesktopEnvironmentFactory::~IpcDesktopEnvironmentFactory() { } +void IpcDesktopEnvironmentFactory::SetActivated(bool activated) { + DCHECK(caller_task_runner_->BelongsToCurrentThread()); + + curtain_activated_ = activated; +} + scoped_ptr<DesktopEnvironment> IpcDesktopEnvironmentFactory::Create( const std::string& client_jid, const base::Closure& disconnect_callback) { @@ -101,7 +109,7 @@ scoped_ptr<DesktopEnvironment> IpcDesktopEnvironmentFactory::Create( return scoped_ptr<DesktopEnvironment>(new IpcDesktopEnvironment( caller_task_runner_, io_task_runner_, client_jid, disconnect_callback, - connector_factory_.GetWeakPtr())); + connector_factory_.GetWeakPtr(), curtain_activated_)); } bool IpcDesktopEnvironmentFactory::SupportsAudioCapture() const { diff --git a/remoting/host/ipc_desktop_environment.h b/remoting/host/ipc_desktop_environment.h index be20cff..e812178 100644 --- a/remoting/host/ipc_desktop_environment.h +++ b/remoting/host/ipc_desktop_environment.h @@ -13,6 +13,7 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" +#include "remoting/host/curtain_mode.h" #include "remoting/host/desktop_environment.h" #include "remoting/host/desktop_session_connector.h" @@ -40,7 +41,8 @@ class IpcDesktopEnvironment : public DesktopEnvironment { scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, const std::string& client_jid, const base::Closure& disconnect_callback, - base::WeakPtr<DesktopSessionConnector> desktop_session_connector); + base::WeakPtr<DesktopSessionConnector> desktop_session_connector, + bool curtain_required); virtual ~IpcDesktopEnvironment(); // DesktopEnvironment implementation. @@ -75,7 +77,8 @@ class IpcDesktopEnvironment : public DesktopEnvironment { // Used to create IpcDesktopEnvironment objects integrating with the desktop via // a helper process and talking to that process via IPC. class IpcDesktopEnvironmentFactory - : public DesktopEnvironmentFactory, + : public CurtainMode, + public DesktopEnvironmentFactory, public DesktopSessionConnector { public: // Passes a reference to the IPC channel connected to the daemon process and @@ -86,6 +89,9 @@ class IpcDesktopEnvironmentFactory IPC::Sender* daemon_channel); virtual ~IpcDesktopEnvironmentFactory(); + // CurtainMode implementation. + virtual void SetActivated(bool activated) OVERRIDE; + // DesktopEnvironmentFactory implementation. virtual scoped_ptr<DesktopEnvironment> Create( const std::string& client_jid, @@ -110,6 +116,9 @@ class IpcDesktopEnvironmentFactory // Task runner used for running background I/O. scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; + // True if curtain mode is activated. + bool curtain_activated_; + // IPC channel connected to the daemon process. IPC::Sender* daemon_channel_; diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc index 344fa73..dcdce59 100644 --- a/remoting/host/remoting_me2me_host.cc +++ b/remoting/host/remoting_me2me_host.cc @@ -858,6 +858,12 @@ bool HostProcess::OnCurtainPolicyUpdate(bool curtain_required) { curtain_required_ = curtain_required; if (curtaining_host_observer_) curtaining_host_observer_->SetEnableCurtaining(curtain_required_); + + // The current Windows curtain mode implementation relies on this code + // restarting the host when the curtain mode policy changes. For example if + // the policy is enabled while someone is already connected to the console + // that session should be either curtained or disconnected. This code makes + // sure that the session will be disconnected by restarting the host. return true; } return false; @@ -954,10 +960,18 @@ void HostProcess::StartHost() { resizing_host_observer_.reset( new ResizingHostObserver(desktop_resizer_.get(), host_->AsWeakPtr())); +#if defined(REMOTING_RDP_SESSION) + // TODO(alexeypa): do not create |curtain_| in this case. + CurtainMode* curtain = static_cast<IpcDesktopEnvironmentFactory*>( + desktop_environment_factory_.get()); +#else // !defined(REMOTING_RDP_SESSION) + CurtainMode* curtain = curtain_.get(); +#endif // !defined(REMOTING_RDP_SESSION) + // Create a host observer to enable/disable curtain mode as clients connect // and disconnect. curtaining_host_observer_.reset(new CurtainingHostObserver( - curtain_.get(), host_->AsWeakPtr())); + curtain, host_->AsWeakPtr())); curtaining_host_observer_->SetEnableCurtaining(curtain_required_); if (host_user_interface_.get()) { diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp index 02430eb..daf3619 100644 --- a/remoting/remoting.gyp +++ b/remoting/remoting.gyp @@ -20,6 +20,7 @@ }, 'remoting_multi_process%': '<(remoting_multi_process)', + 'remoting_rdp_session%': 0, 'remoting_use_apps_v2%': 0, # The |major|, |build| and |patch| versions are inherited from Chrome. @@ -264,6 +265,12 @@ 'REMOTING_ENABLE_BREAKPAD' ], }], + ['OS=="win" and remoting_multi_process != 0 and \ + remoting_rdp_session != 0', { + 'defines': [ + 'REMOTING_RDP_SESSION', + ], + }], ['remoting_multi_process != 0', { 'defines': [ 'REMOTING_MULTI_PROCESS', |