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/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
17 } // namespace base | 17 } // namespace base |
18 | 18 |
19 namespace media { | 19 namespace media { |
20 class ScreenCapturer; | 20 class ScreenCapturer; |
21 } // namespace media | 21 } // namespace media |
22 | 22 |
23 namespace remoting { | 23 namespace remoting { |
24 | 24 |
25 class AudioCapturer; | 25 class AudioCapturer; |
26 class EventExecutor; | 26 class EventExecutor; |
| 27 class SessionController; |
27 | 28 |
28 // Provides factory methods for creation of audio/video capturers and event | 29 // Provides factory methods for creation of audio/video capturers and event |
29 // executor for a given desktop environment. | 30 // executor for a given desktop environment. |
30 class DesktopEnvironment { | 31 class DesktopEnvironment { |
31 public: | 32 public: |
32 virtual ~DesktopEnvironment() {} | 33 virtual ~DesktopEnvironment() {} |
33 | 34 |
34 // Factory methods used to create audio/video capturers and event executor for | 35 // Factory methods used to create audio/video capturers, event executor, and |
35 // a particular desktop environment. | 36 // session controller for a particular desktop environment. |
36 virtual scoped_ptr<AudioCapturer> CreateAudioCapturer( | 37 virtual scoped_ptr<AudioCapturer> CreateAudioCapturer( |
37 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner) = 0; | 38 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner) = 0; |
38 virtual scoped_ptr<EventExecutor> CreateEventExecutor( | 39 virtual scoped_ptr<EventExecutor> CreateEventExecutor( |
39 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 40 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
40 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) = 0; | 41 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) = 0; |
| 42 virtual scoped_ptr<SessionController> CreateSessionController() = 0; |
41 virtual scoped_ptr<media::ScreenCapturer> CreateVideoCapturer( | 43 virtual scoped_ptr<media::ScreenCapturer> CreateVideoCapturer( |
42 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, | 44 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, |
43 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) = 0; | 45 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) = 0; |
44 }; | 46 }; |
45 | 47 |
46 // Used to create |DesktopEnvironment| instances. | 48 // Used to create |DesktopEnvironment| instances. |
47 class DesktopEnvironmentFactory { | 49 class DesktopEnvironmentFactory { |
48 public: | 50 public: |
49 virtual ~DesktopEnvironmentFactory() {} | 51 virtual ~DesktopEnvironmentFactory() {} |
50 | 52 |
51 // Creates an instance of |DesktopEnvironment|. |disconnect_callback| may be | 53 // Creates an instance of |DesktopEnvironment|. |disconnect_callback| may be |
52 // used by the DesktopEnvironment to disconnect the client session. | 54 // used by the DesktopEnvironment to disconnect the client session. |
53 virtual scoped_ptr<DesktopEnvironment> Create( | 55 virtual scoped_ptr<DesktopEnvironment> Create( |
54 const std::string& client_jid, | 56 const std::string& client_jid, |
55 const base::Closure& disconnect_callback) = 0; | 57 const base::Closure& disconnect_callback) = 0; |
56 | 58 |
57 // Returns |true| if created |DesktopEnvironment| instances support audio | 59 // Returns |true| if created |DesktopEnvironment| instances support audio |
58 // capture. | 60 // capture. |
59 virtual bool SupportsAudioCapture() const = 0; | 61 virtual bool SupportsAudioCapture() const = 0; |
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 |