| 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_BASIC_DESKTOP_ENVIRONMENT_H_ | 5 #ifndef REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_ |
| 6 #define REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_ | 6 #define REMOTING_HOST_BASIC_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/compiler_specific.h" | 11 #include "base/compiler_specific.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 #include "remoting/host/desktop_environment.h" | 14 #include "remoting/host/desktop_environment.h" |
| 15 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h" |
| 15 | 16 |
| 16 namespace remoting { | 17 namespace remoting { |
| 17 | 18 |
| 18 // Used to create audio/video capturers and event executor that work with | 19 // Used to create audio/video capturers and event executor that work with |
| 19 // the local console. | 20 // the local console. |
| 20 class BasicDesktopEnvironment : public DesktopEnvironment { | 21 class BasicDesktopEnvironment : public DesktopEnvironment { |
| 21 public: | 22 public: |
| 22 virtual ~BasicDesktopEnvironment(); | 23 virtual ~BasicDesktopEnvironment(); |
| 23 | 24 |
| 24 // DesktopEnvironment implementation. | 25 // DesktopEnvironment implementation. |
| 25 virtual scoped_ptr<AudioCapturer> CreateAudioCapturer() OVERRIDE; | 26 virtual scoped_ptr<AudioCapturer> CreateAudioCapturer() OVERRIDE; |
| 26 virtual scoped_ptr<InputInjector> CreateInputInjector() OVERRIDE; | 27 virtual scoped_ptr<InputInjector> CreateInputInjector() OVERRIDE; |
| 27 virtual scoped_ptr<ScreenControls> CreateScreenControls() OVERRIDE; | 28 virtual scoped_ptr<ScreenControls> CreateScreenControls() OVERRIDE; |
| 28 virtual scoped_ptr<webrtc::ScreenCapturer> CreateVideoCapturer() OVERRIDE; | 29 virtual scoped_ptr<webrtc::ScreenCapturer> CreateVideoCapturer() OVERRIDE; |
| 30 virtual scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor() |
| 31 OVERRIDE; |
| 29 virtual std::string GetCapabilities() const OVERRIDE; | 32 virtual std::string GetCapabilities() const OVERRIDE; |
| 30 virtual void SetCapabilities(const std::string& capabilities) OVERRIDE; | 33 virtual void SetCapabilities(const std::string& capabilities) OVERRIDE; |
| 31 | 34 |
| 32 protected: | 35 protected: |
| 33 friend class BasicDesktopEnvironmentFactory; | 36 friend class BasicDesktopEnvironmentFactory; |
| 34 | 37 |
| 35 BasicDesktopEnvironment( | 38 BasicDesktopEnvironment( |
| 36 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 39 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 37 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 40 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 38 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 41 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
| 39 | 42 |
| 40 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { | 43 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { |
| 41 return caller_task_runner_; | 44 return caller_task_runner_; |
| 42 } | 45 } |
| 43 | 46 |
| 44 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { | 47 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { |
| 45 return input_task_runner_; | 48 return input_task_runner_; |
| 46 } | 49 } |
| 47 | 50 |
| 48 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { | 51 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { |
| 49 return ui_task_runner_; | 52 return ui_task_runner_; |
| 50 } | 53 } |
| 51 | 54 |
| 55 webrtc::DesktopCaptureOptions* desktop_capture_options() { |
| 56 return &desktop_capture_options_; |
| 57 } |
| 58 |
| 52 private: | 59 private: |
| 53 // Task runner on which methods of DesktopEnvironment interface should be | 60 // Task runner on which methods of DesktopEnvironment interface should be |
| 54 // called. | 61 // called. |
| 55 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; | 62 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; |
| 56 | 63 |
| 57 // Used to run input-related tasks. | 64 // Used to run input-related tasks. |
| 58 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; | 65 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; |
| 59 | 66 |
| 60 // Used to run UI code. | 67 // Used to run UI code. |
| 61 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 68 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
| 62 | 69 |
| 70 // Options shared between |ScreenCapturer| and |MouseCursorMonitor|. It |
| 71 // might contain expensive resources, thus justifying the sharing. |
| 72 webrtc::DesktopCaptureOptions desktop_capture_options_; |
| 73 |
| 63 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironment); | 74 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironment); |
| 64 }; | 75 }; |
| 65 | 76 |
| 66 // Used to create |BasicDesktopEnvironment| instances. | 77 // Used to create |BasicDesktopEnvironment| instances. |
| 67 class BasicDesktopEnvironmentFactory : public DesktopEnvironmentFactory { | 78 class BasicDesktopEnvironmentFactory : public DesktopEnvironmentFactory { |
| 68 public: | 79 public: |
| 69 BasicDesktopEnvironmentFactory( | 80 BasicDesktopEnvironmentFactory( |
| 70 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 81 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 71 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 82 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 72 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 83 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 98 | 109 |
| 99 // Used to run UI code. | 110 // Used to run UI code. |
| 100 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 111 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
| 101 | 112 |
| 102 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironmentFactory); | 113 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironmentFactory); |
| 103 }; | 114 }; |
| 104 | 115 |
| 105 } // namespace remoting | 116 } // namespace remoting |
| 106 | 117 |
| 107 #endif // REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_ | 118 #endif // REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_ |
| OLD | NEW |