| 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/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 std::string GetCapabilities() const override; | 38 std::string GetCapabilities() const override; |
| 39 void SetCapabilities(const std::string& capabilities) override; | 39 void SetCapabilities(const std::string& capabilities) override; |
| 40 scoped_ptr<GnubbyAuthHandler> CreateGnubbyAuthHandler( | 40 scoped_ptr<GnubbyAuthHandler> CreateGnubbyAuthHandler( |
| 41 protocol::ClientStub* client_stub) override; | 41 protocol::ClientStub* client_stub) override; |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 friend class BasicDesktopEnvironmentFactory; | 44 friend class BasicDesktopEnvironmentFactory; |
| 45 | 45 |
| 46 BasicDesktopEnvironment( | 46 BasicDesktopEnvironment( |
| 47 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 47 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 48 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner, |
| 48 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 49 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 49 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 50 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| 50 bool supports_touch_events); | 51 bool supports_touch_events); |
| 51 | 52 |
| 52 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { | 53 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { |
| 53 return caller_task_runner_; | 54 return caller_task_runner_; |
| 54 } | 55 } |
| 55 | 56 |
| 57 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner() |
| 58 const { |
| 59 return video_capture_task_runner_; |
| 60 } |
| 61 |
| 56 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { | 62 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { |
| 57 return input_task_runner_; | 63 return input_task_runner_; |
| 58 } | 64 } |
| 59 | 65 |
| 60 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { | 66 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { |
| 61 return ui_task_runner_; | 67 return ui_task_runner_; |
| 62 } | 68 } |
| 63 | 69 |
| 64 webrtc::DesktopCaptureOptions* desktop_capture_options() { | 70 webrtc::DesktopCaptureOptions* desktop_capture_options() { |
| 65 return desktop_capture_options_.get(); | 71 return desktop_capture_options_.get(); |
| 66 } | 72 } |
| 67 | 73 |
| 68 private: | 74 private: |
| 69 // Task runner on which methods of DesktopEnvironment interface should be | 75 // Task runner on which methods of DesktopEnvironment interface should be |
| 70 // called. | 76 // called. |
| 71 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; | 77 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; |
| 72 | 78 |
| 79 // Used to run video capturer. |
| 80 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner_; |
| 81 |
| 73 // Used to run input-related tasks. | 82 // Used to run input-related tasks. |
| 74 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; | 83 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; |
| 75 | 84 |
| 76 // Used to run UI code. | 85 // Used to run UI code. |
| 77 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 86 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
| 78 | 87 |
| 79 // Options shared between |DesktopCapturer| and |MouseCursorMonitor|. It | 88 // Options shared between |DesktopCapturer| and |MouseCursorMonitor|. It |
| 80 // might contain expensive resources, thus justifying the sharing. | 89 // might contain expensive resources, thus justifying the sharing. |
| 81 // Also: it's dynamically allocated to avoid having to bring in | 90 // Also: it's dynamically allocated to avoid having to bring in |
| 82 // desktop_capture_options.h which brings in X11 headers which causes hard to | 91 // desktop_capture_options.h which brings in X11 headers which causes hard to |
| 83 // find build errors. | 92 // find build errors. |
| 84 scoped_ptr<webrtc::DesktopCaptureOptions> desktop_capture_options_; | 93 scoped_ptr<webrtc::DesktopCaptureOptions> desktop_capture_options_; |
| 85 | 94 |
| 86 // True if the touch events capability should be offered. | 95 // True if the touch events capability should be offered. |
| 87 const bool supports_touch_events_; | 96 const bool supports_touch_events_; |
| 88 | 97 |
| 89 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironment); | 98 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironment); |
| 90 }; | 99 }; |
| 91 | 100 |
| 92 // Used to create |BasicDesktopEnvironment| instances. | 101 // Used to create |BasicDesktopEnvironment| instances. |
| 93 class BasicDesktopEnvironmentFactory : public DesktopEnvironmentFactory { | 102 class BasicDesktopEnvironmentFactory : public DesktopEnvironmentFactory { |
| 94 public: | 103 public: |
| 95 BasicDesktopEnvironmentFactory( | 104 BasicDesktopEnvironmentFactory( |
| 96 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 105 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 106 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner, |
| 97 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 107 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 98 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 108 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
| 99 ~BasicDesktopEnvironmentFactory() override; | 109 ~BasicDesktopEnvironmentFactory() override; |
| 100 | 110 |
| 101 // DesktopEnvironmentFactory implementation. | 111 // DesktopEnvironmentFactory implementation. |
| 102 bool SupportsAudioCapture() const override; | 112 bool SupportsAudioCapture() const override; |
| 103 | 113 |
| 104 void set_supports_touch_events(bool enable) { | 114 void set_supports_touch_events(bool enable) { |
| 105 supports_touch_events_ = enable; | 115 supports_touch_events_ = enable; |
| 106 } | 116 } |
| 107 | 117 |
| 108 protected: | 118 protected: |
| 109 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { | 119 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { |
| 110 return caller_task_runner_; | 120 return caller_task_runner_; |
| 111 } | 121 } |
| 112 | 122 |
| 123 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner() |
| 124 const { |
| 125 return video_capture_task_runner_; |
| 126 } |
| 127 |
| 113 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { | 128 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { |
| 114 return input_task_runner_; | 129 return input_task_runner_; |
| 115 } | 130 } |
| 116 | 131 |
| 117 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { | 132 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { |
| 118 return ui_task_runner_; | 133 return ui_task_runner_; |
| 119 } | 134 } |
| 120 | 135 |
| 121 bool supports_touch_events() const { return supports_touch_events_; } | 136 bool supports_touch_events() const { return supports_touch_events_; } |
| 122 | 137 |
| 123 private: | 138 private: |
| 124 // Task runner on which methods of DesktopEnvironmentFactory interface should | 139 // Task runner on which methods of DesktopEnvironmentFactory interface should |
| 125 // be called. | 140 // be called. |
| 126 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; | 141 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; |
| 127 | 142 |
| 143 // Used to run video capture tasks. |
| 144 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner_; |
| 145 |
| 128 // Used to run input-related tasks. | 146 // Used to run input-related tasks. |
| 129 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; | 147 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; |
| 130 | 148 |
| 131 // Used to run UI code. | 149 // Used to run UI code. |
| 132 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 150 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
| 133 | 151 |
| 134 // True if the touch events capability should be offered by the | 152 // True if the touch events capability should be offered by the |
| 135 // DesktopEnvironment instances. | 153 // DesktopEnvironment instances. |
| 136 bool supports_touch_events_; | 154 bool supports_touch_events_; |
| 137 | 155 |
| 138 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironmentFactory); | 156 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironmentFactory); |
| 139 }; | 157 }; |
| 140 | 158 |
| 141 } // namespace remoting | 159 } // namespace remoting |
| 142 | 160 |
| 143 #endif // REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_ | 161 #endif // REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_ |
| OLD | NEW |