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" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/time.h" | 13 #include "base/time.h" |
14 #include "remoting/base/scoped_thread_proxy.h" | 14 #include "remoting/base/scoped_thread_proxy.h" |
15 | 15 |
16 namespace remoting { | 16 namespace remoting { |
17 | 17 |
18 class Capturer; | 18 class Capturer; |
19 class ChromotingHost; | 19 class ChromotingHost; |
20 class ChromotingHostContext; | 20 class ChromotingHostContext; |
21 | 21 |
22 namespace protocol { | 22 namespace protocol { |
23 class InputStub; | 23 class HostEventStub; |
24 }; | 24 }; |
25 | 25 |
26 class DesktopEnvironment { | 26 class DesktopEnvironment { |
27 public: | 27 public: |
28 static scoped_ptr<DesktopEnvironment> Create(ChromotingHostContext* context); | 28 static scoped_ptr<DesktopEnvironment> Create(ChromotingHostContext* context); |
29 static scoped_ptr<DesktopEnvironment> CreateFake( | 29 static scoped_ptr<DesktopEnvironment> CreateFake( |
30 ChromotingHostContext* context, | 30 ChromotingHostContext* context, |
31 scoped_ptr<Capturer> capturer, | 31 scoped_ptr<Capturer> capturer, |
32 scoped_ptr<protocol::InputStub> event_executor); | 32 scoped_ptr<protocol::HostEventStub> event_executor); |
33 | 33 |
34 virtual ~DesktopEnvironment(); | 34 virtual ~DesktopEnvironment(); |
35 | 35 |
36 void set_host(ChromotingHost* host) { host_ = host; } | 36 void set_host(ChromotingHost* host) { host_ = host; } |
37 | 37 |
38 Capturer* capturer() const { return capturer_.get(); } | 38 Capturer* capturer() const { return capturer_.get(); } |
39 protocol::InputStub* event_executor() const { return event_executor_.get(); } | 39 protocol::HostEventStub* event_executor() const { |
| 40 return event_executor_.get(); |
| 41 } |
40 | 42 |
41 private: | 43 private: |
42 DesktopEnvironment(ChromotingHostContext* context, | 44 DesktopEnvironment(ChromotingHostContext* context, |
43 scoped_ptr<Capturer> capturer, | 45 scoped_ptr<Capturer> capturer, |
44 scoped_ptr<protocol::InputStub> event_executor); | 46 scoped_ptr<protocol::HostEventStub> event_executor); |
45 | 47 |
46 // The host that owns this DesktopEnvironment. | 48 // The host that owns this DesktopEnvironment. |
47 ChromotingHost* host_; | 49 ChromotingHost* host_; |
48 | 50 |
49 // 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. |
50 // This is owned by the ChromotingHost. | 52 // This is owned by the ChromotingHost. |
51 ChromotingHostContext* context_; | 53 ChromotingHostContext* context_; |
52 | 54 |
53 // Capturer to be used by ScreenRecorder. | 55 // Capturer to be used by ScreenRecorder. |
54 scoped_ptr<Capturer> capturer_; | 56 scoped_ptr<Capturer> capturer_; |
55 | 57 |
56 // Executes input events received from the client. | 58 // Executes input and clipboard events received from the client. |
57 scoped_ptr<protocol::InputStub> event_executor_; | 59 scoped_ptr<protocol::HostEventStub> event_executor_; |
58 | 60 |
59 DISALLOW_COPY_AND_ASSIGN(DesktopEnvironment); | 61 DISALLOW_COPY_AND_ASSIGN(DesktopEnvironment); |
60 }; | 62 }; |
61 | 63 |
62 } // namespace remoting | 64 } // namespace remoting |
63 | 65 |
64 #endif // REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ | 66 #endif // REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ |
OLD | NEW |