| 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" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 scoped_ptr<AudioCapturer> CreateAudioCapturer() override; | 33 scoped_ptr<AudioCapturer> CreateAudioCapturer() override; |
| 34 scoped_ptr<InputInjector> CreateInputInjector() override; | 34 scoped_ptr<InputInjector> CreateInputInjector() override; |
| 35 scoped_ptr<ScreenControls> CreateScreenControls() override; | 35 scoped_ptr<ScreenControls> CreateScreenControls() override; |
| 36 scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer() override; | 36 scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer() override; |
| 37 scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor() override; | 37 scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor() override; |
| 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 void SetEnableMultiTouch(bool enable); |
| 44 |
| 43 protected: | 45 protected: |
| 44 friend class BasicDesktopEnvironmentFactory; | 46 friend class BasicDesktopEnvironmentFactory; |
| 45 | 47 |
| 46 BasicDesktopEnvironment( | 48 BasicDesktopEnvironment( |
| 47 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 49 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 48 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 50 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 49 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 51 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
| 50 | 52 |
| 51 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { | 53 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { |
| 52 return caller_task_runner_; | 54 return caller_task_runner_; |
| 53 } | 55 } |
| 54 | 56 |
| 55 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { | 57 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { |
| 56 return input_task_runner_; | 58 return input_task_runner_; |
| 57 } | 59 } |
| 58 | 60 |
| 59 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { | 61 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { |
| 60 return ui_task_runner_; | 62 return ui_task_runner_; |
| 61 } | 63 } |
| 62 | 64 |
| 63 webrtc::DesktopCaptureOptions* desktop_capture_options() { | 65 webrtc::DesktopCaptureOptions* desktop_capture_options() { |
| 64 return desktop_capture_options_.get(); | 66 return desktop_capture_options_.get(); |
| 65 } | 67 } |
| 66 | 68 |
| 69 bool multi_touch_enabled() const { return multi_touch_enabled_; } |
| 70 |
| 67 private: | 71 private: |
| 68 // Task runner on which methods of DesktopEnvironment interface should be | 72 // Task runner on which methods of DesktopEnvironment interface should be |
| 69 // called. | 73 // called. |
| 70 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; | 74 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; |
| 71 | 75 |
| 72 // Used to run input-related tasks. | 76 // Used to run input-related tasks. |
| 73 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; | 77 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; |
| 74 | 78 |
| 75 // Used to run UI code. | 79 // Used to run UI code. |
| 76 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 80 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
| 77 | 81 |
| 78 // Options shared between |DesktopCapturer| and |MouseCursorMonitor|. It | 82 // Options shared between |DesktopCapturer| and |MouseCursorMonitor|. It |
| 79 // might contain expensive resources, thus justifying the sharing. | 83 // might contain expensive resources, thus justifying the sharing. |
| 80 // Also: it's dynamically allocated to avoid having to bring in | 84 // Also: it's dynamically allocated to avoid having to bring in |
| 81 // desktop_capture_options.h which brings in X11 headers which causes hard to | 85 // desktop_capture_options.h which brings in X11 headers which causes hard to |
| 82 // find build errors. | 86 // find build errors. |
| 83 scoped_ptr<webrtc::DesktopCaptureOptions> desktop_capture_options_; | 87 scoped_ptr<webrtc::DesktopCaptureOptions> desktop_capture_options_; |
| 84 | 88 |
| 89 bool multi_touch_enabled_; |
| 90 |
| 85 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironment); | 91 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironment); |
| 86 }; | 92 }; |
| 87 | 93 |
| 88 // Used to create |BasicDesktopEnvironment| instances. | 94 // Used to create |BasicDesktopEnvironment| instances. |
| 89 class BasicDesktopEnvironmentFactory : public DesktopEnvironmentFactory { | 95 class BasicDesktopEnvironmentFactory : public DesktopEnvironmentFactory { |
| 90 public: | 96 public: |
| 91 BasicDesktopEnvironmentFactory( | 97 BasicDesktopEnvironmentFactory( |
| 92 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 98 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 93 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 99 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 94 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 100 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
| 95 ~BasicDesktopEnvironmentFactory() override; | 101 ~BasicDesktopEnvironmentFactory() override; |
| 96 | 102 |
| 97 // DesktopEnvironmentFactory implementation. | 103 // DesktopEnvironmentFactory implementation. |
| 98 bool SupportsAudioCapture() const override; | 104 bool SupportsAudioCapture() const override; |
| 105 void SetEnableMultiTouch(bool enable) override; |
| 99 | 106 |
| 100 protected: | 107 protected: |
| 101 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { | 108 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { |
| 102 return caller_task_runner_; | 109 return caller_task_runner_; |
| 103 } | 110 } |
| 104 | 111 |
| 105 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { | 112 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { |
| 106 return input_task_runner_; | 113 return input_task_runner_; |
| 107 } | 114 } |
| 108 | 115 |
| 109 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { | 116 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { |
| 110 return ui_task_runner_; | 117 return ui_task_runner_; |
| 111 } | 118 } |
| 112 | 119 |
| 120 bool multi_touch_enabled() const { return multi_touch_enabled_; } |
| 121 |
| 113 private: | 122 private: |
| 114 // Task runner on which methods of DesktopEnvironmentFactory interface should | 123 // Task runner on which methods of DesktopEnvironmentFactory interface should |
| 115 // be called. | 124 // be called. |
| 116 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; | 125 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; |
| 117 | 126 |
| 118 // Used to run input-related tasks. | 127 // Used to run input-related tasks. |
| 119 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; | 128 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; |
| 120 | 129 |
| 121 // Used to run UI code. | 130 // Used to run UI code. |
| 122 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 131 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
| 123 | 132 |
| 133 bool multi_touch_enabled_; |
| 134 |
| 124 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironmentFactory); | 135 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironmentFactory); |
| 125 }; | 136 }; |
| 126 | 137 |
| 127 } // namespace remoting | 138 } // namespace remoting |
| 128 | 139 |
| 129 #endif // REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_ | 140 #endif // REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_ |
| OLD | NEW |