| 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_IPC_DESKTOP_ENVIRONMENT_H_ | 5 #ifndef REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_ |
| 6 #define REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_ | 6 #define REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // |desktop_session_connector| is used to bind DesktopSessionProxy to | 38 // |desktop_session_connector| is used to bind DesktopSessionProxy to |
| 39 // a desktop session, to be notified every time the desktop process is | 39 // a desktop session, to be notified every time the desktop process is |
| 40 // restarted. | 40 // restarted. |
| 41 IpcDesktopEnvironment( | 41 IpcDesktopEnvironment( |
| 42 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, | 42 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, |
| 43 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 43 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 44 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, | 44 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, |
| 45 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, | 45 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
| 46 base::WeakPtr<ClientSessionControl> client_session_control, | 46 base::WeakPtr<ClientSessionControl> client_session_control, |
| 47 base::WeakPtr<DesktopSessionConnector> desktop_session_connector, | 47 base::WeakPtr<DesktopSessionConnector> desktop_session_connector, |
| 48 bool virtual_terminal); | 48 bool virtual_terminal, |
| 49 bool supports_touch_events); |
| 49 ~IpcDesktopEnvironment() override; | 50 ~IpcDesktopEnvironment() override; |
| 50 | 51 |
| 51 // DesktopEnvironment implementation. | 52 // DesktopEnvironment implementation. |
| 52 scoped_ptr<AudioCapturer> CreateAudioCapturer() override; | 53 scoped_ptr<AudioCapturer> CreateAudioCapturer() override; |
| 53 scoped_ptr<InputInjector> CreateInputInjector() override; | 54 scoped_ptr<InputInjector> CreateInputInjector() override; |
| 54 scoped_ptr<ScreenControls> CreateScreenControls() override; | 55 scoped_ptr<ScreenControls> CreateScreenControls() override; |
| 55 scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer() override; | 56 scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer() override; |
| 56 scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor() override; | 57 scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor() override; |
| 57 std::string GetCapabilities() const override; | 58 std::string GetCapabilities() const override; |
| 58 void SetCapabilities(const std::string& capabilities) override; | 59 void SetCapabilities(const std::string& capabilities) override; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 bool virtual_terminal) override; | 94 bool virtual_terminal) override; |
| 94 void DisconnectTerminal(DesktopSessionProxy* desktop_session_proxy) override; | 95 void DisconnectTerminal(DesktopSessionProxy* desktop_session_proxy) override; |
| 95 void SetScreenResolution(DesktopSessionProxy* desktop_session_proxy, | 96 void SetScreenResolution(DesktopSessionProxy* desktop_session_proxy, |
| 96 const ScreenResolution& resolution) override; | 97 const ScreenResolution& resolution) override; |
| 97 void OnDesktopSessionAgentAttached( | 98 void OnDesktopSessionAgentAttached( |
| 98 int terminal_id, | 99 int terminal_id, |
| 99 base::ProcessHandle desktop_process_handle, | 100 base::ProcessHandle desktop_process_handle, |
| 100 IPC::PlatformFileForTransit desktop_pipe) override; | 101 IPC::PlatformFileForTransit desktop_pipe) override; |
| 101 void OnTerminalDisconnected(int terminal_id) override; | 102 void OnTerminalDisconnected(int terminal_id) override; |
| 102 | 103 |
| 104 // Enables or disables touch events capability. |
| 105 void set_supports_touch_events(bool enable) { |
| 106 supports_touch_events_ = enable; |
| 107 } |
| 108 |
| 103 private: | 109 private: |
| 104 // Used to run the audio capturer. | 110 // Used to run the audio capturer. |
| 105 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; | 111 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; |
| 106 | 112 |
| 107 // Task runner on which methods of DesktopEnvironmentFactory interface should | 113 // Task runner on which methods of DesktopEnvironmentFactory interface should |
| 108 // be called. | 114 // be called. |
| 109 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; | 115 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; |
| 110 | 116 |
| 111 // Used to run the video capturer. | 117 // Used to run the video capturer. |
| 112 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_; | 118 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 125 ActiveConnectionsList active_connections_; | 131 ActiveConnectionsList active_connections_; |
| 126 | 132 |
| 127 // Next desktop session ID. IDs are allocated sequentially starting from 0. | 133 // Next desktop session ID. IDs are allocated sequentially starting from 0. |
| 128 // This gives us more than 67 years of unique IDs assuming a new ID is | 134 // This gives us more than 67 years of unique IDs assuming a new ID is |
| 129 // allocated every second. | 135 // allocated every second. |
| 130 int next_id_; | 136 int next_id_; |
| 131 | 137 |
| 132 // Factory for weak pointers to DesktopSessionConnector interface. | 138 // Factory for weak pointers to DesktopSessionConnector interface. |
| 133 base::WeakPtrFactory<DesktopSessionConnector> connector_factory_; | 139 base::WeakPtrFactory<DesktopSessionConnector> connector_factory_; |
| 134 | 140 |
| 141 // If true then the newly Create()ed desktop environments support touch |
| 142 // events. |
| 143 bool supports_touch_events_; |
| 144 |
| 135 DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironmentFactory); | 145 DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironmentFactory); |
| 136 }; | 146 }; |
| 137 | 147 |
| 138 } // namespace remoting | 148 } // namespace remoting |
| 139 | 149 |
| 140 #endif // REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_ | 150 #endif // REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_ |
| OLD | NEW |