Index: remoting/host/desktop_environment.h |
diff --git a/remoting/host/desktop_environment.h b/remoting/host/desktop_environment.h |
index f95089bd90a971a40cf97433c5cabdb658da541a..611227f79a979c0113d29b55f08c47322b5cea01 100644 |
--- a/remoting/host/desktop_environment.h |
+++ b/remoting/host/desktop_environment.h |
@@ -11,8 +11,16 @@ |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/time.h" |
+#include "ipc/ipc_channel.h" |
#include "remoting/base/scoped_thread_proxy.h" |
+namespace IPC { |
+ |
+class ChannelProxy; |
+class Message; |
+ |
+} // namespace IPC |
+ |
namespace remoting { |
class Capturer; |
@@ -20,22 +28,35 @@ class ChromotingHost; |
class ChromotingHostContext; |
class EventExecutor; |
-class DesktopEnvironment { |
+class DesktopEnvironment : public IPC::Channel::Listener { |
public: |
- static DesktopEnvironment* Create(ChromotingHostContext* context); |
+ // Creates DesktopEnvironment along with the capturer and event executor. |
+ // |context| is assumed to be owned by the ChromotingHost. |
+ static scoped_ptr<DesktopEnvironment> Create(ChromotingHostContext* context); |
+ |
+ // Creates DesktopEnvironment using the passed |capturer| and |event_executor| |
+ // taking their ownership. |context| is assumed to be owned by |
+ // the ChromotingHost. |
+ static scoped_ptr<DesktopEnvironment> CreateFake( |
+ ChromotingHostContext* context, |
+ Capturer* capturer, |
+ EventExecutor* event_executor); |
- // DesktopEnvironment takes ownership of all the objects passed in. |
- DesktopEnvironment(ChromotingHostContext* context, |
- Capturer* capturer, |
- EventExecutor* event_executor); |
virtual ~DesktopEnvironment(); |
+ // IPC::Channel::Listener implementation. |
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
+ |
void set_host(ChromotingHost* host) { host_ = host; } |
Capturer* capturer() const { return capturer_.get(); } |
EventExecutor* event_executor() const { return event_executor_.get(); } |
private: |
+ DesktopEnvironment(ChromotingHostContext* context); |
+ |
+ bool Initialize(); |
+ |
// The host that owns this DesktopEnvironment. |
ChromotingHost* host_; |
@@ -43,6 +64,9 @@ class DesktopEnvironment { |
// This is owned by the ChromotingHost. |
ChromotingHostContext* context_; |
+ // IPC channel connecting the host with the chromoting service. |
+ scoped_ptr<IPC::ChannelProxy> chromoting_session_; |
+ |
// Capturer to be used by ScreenRecorder. |
scoped_ptr<Capturer> capturer_; |