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