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 ChromotingHostContext; | 17 class ChromotingHostContext; |
21 | 18 |
22 namespace protocol { | 19 namespace protocol { |
| 20 class ClipboardStub; |
23 class HostEventStub; | 21 class HostEventStub; |
24 }; | 22 }; |
25 | 23 |
26 class DesktopEnvironment { | 24 class DesktopEnvironment { |
27 public: | 25 public: |
28 // Creates a DesktopEnvironment used in a host plugin. | 26 // Creates a DesktopEnvironment used in a host plugin. |
29 static scoped_ptr<DesktopEnvironment> Create( | 27 static scoped_ptr<DesktopEnvironment> Create( |
30 ChromotingHostContext* context); | 28 ChromotingHostContext* context); |
31 | 29 |
32 // Creates a DesktopEnvironment used in a service process. | 30 // Creates a DesktopEnvironment used in a service process. |
33 static scoped_ptr<DesktopEnvironment> CreateForService( | 31 static scoped_ptr<DesktopEnvironment> CreateForService( |
34 ChromotingHostContext* context); | 32 ChromotingHostContext* context); |
35 | 33 |
36 static scoped_ptr<DesktopEnvironment> CreateFake( | 34 static scoped_ptr<DesktopEnvironment> CreateFake( |
37 ChromotingHostContext* context, | 35 ChromotingHostContext* context, |
38 scoped_ptr<Capturer> capturer, | 36 scoped_ptr<Capturer> capturer, |
39 scoped_ptr<EventExecutor> event_executor); | 37 scoped_ptr<EventExecutor> event_executor); |
40 | 38 |
41 virtual ~DesktopEnvironment(); | 39 virtual ~DesktopEnvironment(); |
42 | 40 |
43 Capturer* capturer() const { return capturer_.get(); } | 41 Capturer* capturer() const { return capturer_.get(); } |
44 EventExecutor* event_executor() const { return event_executor_.get(); } | 42 EventExecutor* event_executor() const { return event_executor_.get(); } |
45 void OnSessionStarted(); | 43 void OnSessionStarted(scoped_ptr<protocol::ClipboardStub> client_clipboard); |
46 void OnSessionFinished(); | 44 void OnSessionFinished(); |
47 | 45 |
48 private: | 46 private: |
49 DesktopEnvironment(ChromotingHostContext* context, | 47 DesktopEnvironment(ChromotingHostContext* context, |
50 scoped_ptr<Capturer> capturer, | 48 scoped_ptr<Capturer> capturer, |
51 scoped_ptr<EventExecutor> event_executor); | 49 scoped_ptr<EventExecutor> event_executor); |
52 | 50 |
53 // Host context used to make sure operations are run on the correct thread. | 51 // Host context used to make sure operations are run on the correct thread. |
54 // This is owned by the ChromotingHost. | 52 // This is owned by the ChromotingHost. |
55 ChromotingHostContext* context_; | 53 ChromotingHostContext* context_; |
56 | 54 |
57 // Capturer to be used by ScreenRecorder. | 55 // Capturer to be used by ScreenRecorder. |
58 scoped_ptr<Capturer> capturer_; | 56 scoped_ptr<Capturer> capturer_; |
59 | 57 |
60 // Executes input and clipboard events received from the client. | 58 // Executes input and clipboard events received from the client. |
61 scoped_ptr<EventExecutor> event_executor_; | 59 scoped_ptr<EventExecutor> event_executor_; |
62 | 60 |
63 DISALLOW_COPY_AND_ASSIGN(DesktopEnvironment); | 61 DISALLOW_COPY_AND_ASSIGN(DesktopEnvironment); |
64 }; | 62 }; |
65 | 63 |
66 } // namespace remoting | 64 } // namespace remoting |
67 | 65 |
68 #endif // REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ | 66 #endif // REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ |
OLD | NEW |