| 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 #ifndef REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ | 5 #ifndef REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ |
| 6 #define REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ | 6 #define REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/ref_counted.h" | |
| 12 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/time.h" | |
| 14 #include "remoting/base/scoped_thread_proxy.h" | |
| 15 #include "remoting/host/event_executor.h" | 12 #include "remoting/host/event_executor.h" |
| 16 | 13 |
| 17 namespace remoting { | 14 namespace remoting { |
| 18 | 15 |
| 19 class Capturer; | 16 class Capturer; |
| 20 class ChromotingHost; | 17 class ChromotingHost; |
| 21 class ChromotingHostContext; | 18 class ChromotingHostContext; |
| 22 | 19 |
| 23 namespace protocol { | 20 namespace protocol { |
| 21 class ClipboardStub; |
| 24 class HostEventStub; | 22 class HostEventStub; |
| 25 }; | 23 }; |
| 26 | 24 |
| 27 class DesktopEnvironment { | 25 class DesktopEnvironment { |
| 28 public: | 26 public: |
| 29 // Creates a DesktopEnvironment used in a host plugin. | 27 // Creates a DesktopEnvironment used in a host plugin. |
| 30 static scoped_ptr<DesktopEnvironment> Create( | 28 static scoped_ptr<DesktopEnvironment> Create( |
| 31 ChromotingHostContext* context); | 29 ChromotingHostContext* context); |
| 32 | 30 |
| 33 // Creates a DesktopEnvironment used in a service process. | 31 // Creates a DesktopEnvironment used in a service process. |
| 34 static scoped_ptr<DesktopEnvironment> CreateForService( | 32 static scoped_ptr<DesktopEnvironment> CreateForService( |
| 35 ChromotingHostContext* context); | 33 ChromotingHostContext* context); |
| 36 | 34 |
| 37 static scoped_ptr<DesktopEnvironment> CreateFake( | 35 static scoped_ptr<DesktopEnvironment> CreateFake( |
| 38 ChromotingHostContext* context, | 36 ChromotingHostContext* context, |
| 39 scoped_ptr<Capturer> capturer, | 37 scoped_ptr<Capturer> capturer, |
| 40 scoped_ptr<EventExecutor> event_executor); | 38 scoped_ptr<EventExecutor> event_executor); |
| 41 | 39 |
| 42 virtual ~DesktopEnvironment(); | 40 virtual ~DesktopEnvironment(); |
| 43 | 41 |
| 44 void set_host(ChromotingHost* host) { host_ = host; } | 42 void set_host(ChromotingHost* host) { host_ = host; } |
| 45 | 43 |
| 46 Capturer* capturer() const { return capturer_.get(); } | 44 Capturer* capturer() const { return capturer_.get(); } |
| 47 EventExecutor* event_executor() const { return event_executor_.get(); } | 45 EventExecutor* event_executor() const { return event_executor_.get(); } |
| 48 void OnSessionStarted(); | 46 void OnSessionStarted(scoped_ptr<protocol::ClipboardStub> client_clipboard); |
| 49 void OnSessionFinished(); | 47 void OnSessionFinished(); |
| 50 | 48 |
| 51 private: | 49 private: |
| 52 DesktopEnvironment(ChromotingHostContext* context, | 50 DesktopEnvironment(ChromotingHostContext* context, |
| 53 scoped_ptr<Capturer> capturer, | 51 scoped_ptr<Capturer> capturer, |
| 54 scoped_ptr<EventExecutor> event_executor); | 52 scoped_ptr<EventExecutor> event_executor); |
| 55 | 53 |
| 56 // The host that owns this DesktopEnvironment. | 54 // The host that owns this DesktopEnvironment. |
| 57 ChromotingHost* host_; | 55 ChromotingHost* host_; |
| 58 | 56 |
| 59 // Host context used to make sure operations are run on the correct thread. | 57 // Host context used to make sure operations are run on the correct thread. |
| 60 // This is owned by the ChromotingHost. | 58 // This is owned by the ChromotingHost. |
| 61 ChromotingHostContext* context_; | 59 ChromotingHostContext* context_; |
| 62 | 60 |
| 63 // Capturer to be used by ScreenRecorder. | 61 // Capturer to be used by ScreenRecorder. |
| 64 scoped_ptr<Capturer> capturer_; | 62 scoped_ptr<Capturer> capturer_; |
| 65 | 63 |
| 66 // Executes input and clipboard events received from the client. | 64 // Executes input and clipboard events received from the client. |
| 67 scoped_ptr<EventExecutor> event_executor_; | 65 scoped_ptr<EventExecutor> event_executor_; |
| 68 | 66 |
| 69 DISALLOW_COPY_AND_ASSIGN(DesktopEnvironment); | 67 DISALLOW_COPY_AND_ASSIGN(DesktopEnvironment); |
| 70 }; | 68 }; |
| 71 | 69 |
| 72 } // namespace remoting | 70 } // namespace remoting |
| 73 | 71 |
| 74 #endif // REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ | 72 #endif // REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ |
| OLD | NEW |