| 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 28 matching lines...) Expand all Loading... |
| 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> 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); |
| 50 | 51 |
| 51 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { | 52 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { |
| 52 return caller_task_runner_; | 53 return caller_task_runner_; |
| 53 } | 54 } |
| 54 | 55 |
| 55 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { | 56 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { |
| 56 return input_task_runner_; | 57 return input_task_runner_; |
| 57 } | 58 } |
| 58 | 59 |
| 59 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { | 60 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 75 // Used to run UI code. | 76 // Used to run UI code. |
| 76 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 77 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
| 77 | 78 |
| 78 // Options shared between |DesktopCapturer| and |MouseCursorMonitor|. It | 79 // Options shared between |DesktopCapturer| and |MouseCursorMonitor|. It |
| 79 // might contain expensive resources, thus justifying the sharing. | 80 // might contain expensive resources, thus justifying the sharing. |
| 80 // Also: it's dynamically allocated to avoid having to bring in | 81 // 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 | 82 // desktop_capture_options.h which brings in X11 headers which causes hard to |
| 82 // find build errors. | 83 // find build errors. |
| 83 scoped_ptr<webrtc::DesktopCaptureOptions> desktop_capture_options_; | 84 scoped_ptr<webrtc::DesktopCaptureOptions> desktop_capture_options_; |
| 84 | 85 |
| 86 // True if the touch events capability should be offered. |
| 87 const bool supports_touch_events_; |
| 88 |
| 85 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironment); | 89 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironment); |
| 86 }; | 90 }; |
| 87 | 91 |
| 88 // Used to create |BasicDesktopEnvironment| instances. | 92 // Used to create |BasicDesktopEnvironment| instances. |
| 89 class BasicDesktopEnvironmentFactory : public DesktopEnvironmentFactory { | 93 class BasicDesktopEnvironmentFactory : public DesktopEnvironmentFactory { |
| 90 public: | 94 public: |
| 91 BasicDesktopEnvironmentFactory( | 95 BasicDesktopEnvironmentFactory( |
| 92 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 96 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 93 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 97 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 94 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 98 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
| 95 ~BasicDesktopEnvironmentFactory() override; | 99 ~BasicDesktopEnvironmentFactory() override; |
| 96 | 100 |
| 97 // DesktopEnvironmentFactory implementation. | 101 // DesktopEnvironmentFactory implementation. |
| 98 bool SupportsAudioCapture() const override; | 102 bool SupportsAudioCapture() const override; |
| 99 | 103 |
| 104 void set_supports_touch_events(bool enable) { |
| 105 supports_touch_events_ = enable; |
| 106 } |
| 107 |
| 100 protected: | 108 protected: |
| 101 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { | 109 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { |
| 102 return caller_task_runner_; | 110 return caller_task_runner_; |
| 103 } | 111 } |
| 104 | 112 |
| 105 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { | 113 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { |
| 106 return input_task_runner_; | 114 return input_task_runner_; |
| 107 } | 115 } |
| 108 | 116 |
| 109 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { | 117 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { |
| 110 return ui_task_runner_; | 118 return ui_task_runner_; |
| 111 } | 119 } |
| 112 | 120 |
| 121 bool supports_touch_events() const { return supports_touch_events_; } |
| 122 |
| 113 private: | 123 private: |
| 114 // Task runner on which methods of DesktopEnvironmentFactory interface should | 124 // Task runner on which methods of DesktopEnvironmentFactory interface should |
| 115 // be called. | 125 // be called. |
| 116 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; | 126 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; |
| 117 | 127 |
| 118 // Used to run input-related tasks. | 128 // Used to run input-related tasks. |
| 119 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; | 129 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; |
| 120 | 130 |
| 121 // Used to run UI code. | 131 // Used to run UI code. |
| 122 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 132 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
| 123 | 133 |
| 134 // True if the touch events capability should be offered by the |
| 135 // DesktopEnvironment instances. |
| 136 bool supports_touch_events_; |
| 137 |
| 124 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironmentFactory); | 138 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironmentFactory); |
| 125 }; | 139 }; |
| 126 | 140 |
| 127 } // namespace remoting | 141 } // namespace remoting |
| 128 | 142 |
| 129 #endif // REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_ | 143 #endif // REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_ |
| OLD | NEW |