| 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_DESKTOP_SESSION_CONNECTOR_H_ | 5 #ifndef REMOTING_HOST_DESKTOP_SESSION_CONNECTOR_H_ |
| 6 #define REMOTING_HOST_DESKTOP_SESSION_CONNECTOR_H_ | 6 #define REMOTING_HOST_DESKTOP_SESSION_CONNECTOR_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/process.h" | 9 #include "base/process.h" |
| 10 #include "ipc/ipc_platform_file.h" | 10 #include "ipc/ipc_platform_file.h" |
| 11 | 11 |
| 12 namespace remoting { | 12 namespace remoting { |
| 13 | 13 |
| 14 class DesktopSessionProxy; | 14 class DesktopSessionProxy; |
| 15 struct DesktopSessionParams; | 15 struct ScreenResolution; |
| 16 | 16 |
| 17 // Provides a way to connect a terminal (i.e. a remote client) with a desktop | 17 // Provides a way to connect a terminal (i.e. a remote client) with a desktop |
| 18 // session (i.e. the screen, keyboard and the rest). | 18 // session (i.e. the screen, keyboard and the rest). |
| 19 class DesktopSessionConnector { | 19 class DesktopSessionConnector { |
| 20 public: | 20 public: |
| 21 DesktopSessionConnector() {} | 21 DesktopSessionConnector() {} |
| 22 virtual ~DesktopSessionConnector() {} | 22 virtual ~DesktopSessionConnector() {} |
| 23 | 23 |
| 24 // Requests the daemon process to create a desktop session and associates | 24 // Requests the daemon process to create a desktop session and associates |
| 25 // |desktop_session_proxy| with it. |desktop_session_proxy| must be | 25 // |desktop_session_proxy| with it. |desktop_session_proxy| must be |
| 26 // disconnected from the desktop session (see DisconnectTerminal()) before it | 26 // disconnected from the desktop session (see DisconnectTerminal()) before it |
| 27 // can be deleted. | 27 // can be deleted. |
| 28 virtual void ConnectTerminal( | 28 virtual void ConnectTerminal( |
| 29 DesktopSessionProxy* desktop_session_proxy, | 29 DesktopSessionProxy* desktop_session_proxy, |
| 30 const DesktopSessionParams& params, | 30 const ScreenResolution& resolution, |
| 31 bool virtual_terminal) = 0; | 31 bool virtual_terminal) = 0; |
| 32 | 32 |
| 33 // Requests the daemon process disconnect |desktop_session_proxy| from | 33 // Requests the daemon process disconnect |desktop_session_proxy| from |
| 34 // the associated desktop session. | 34 // the associated desktop session. |
| 35 virtual void DisconnectTerminal( | 35 virtual void DisconnectTerminal( |
| 36 DesktopSessionProxy* desktop_session_proxy) = 0; | 36 DesktopSessionProxy* desktop_session_proxy) = 0; |
| 37 | 37 |
| 38 // Notifies the network process that |terminal_id| is now attached to | 38 // Notifies the network process that |terminal_id| is now attached to |
| 39 // a desktop integration process. |desktop_process| specifies the process | 39 // a desktop integration process. |desktop_process| specifies the process |
| 40 // handle. |desktop_pipe| is the client end of the pipe opened by the desktop | 40 // handle. |desktop_pipe| is the client end of the pipe opened by the desktop |
| 41 // process. | 41 // process. |
| 42 virtual void OnDesktopSessionAgentAttached( | 42 virtual void OnDesktopSessionAgentAttached( |
| 43 int terminal_id, | 43 int terminal_id, |
| 44 base::ProcessHandle desktop_process, | 44 base::ProcessHandle desktop_process, |
| 45 IPC::PlatformFileForTransit desktop_pipe) = 0; | 45 IPC::PlatformFileForTransit desktop_pipe) = 0; |
| 46 | 46 |
| 47 // Notifies the network process that the daemon has disconnected the desktop | 47 // Notifies the network process that the daemon has disconnected the desktop |
| 48 // session from the associated desktop environment. | 48 // session from the associated desktop environment. |
| 49 virtual void OnTerminalDisconnected(int terminal_id) = 0; | 49 virtual void OnTerminalDisconnected(int terminal_id) = 0; |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 DISALLOW_COPY_AND_ASSIGN(DesktopSessionConnector); | 52 DISALLOW_COPY_AND_ASSIGN(DesktopSessionConnector); |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 } // namespace remoting | 55 } // namespace remoting |
| 56 | 56 |
| 57 #endif // REMOTING_HOST_DESKTOP_SESSION_CONNECTOR_H_ | 57 #endif // REMOTING_HOST_DESKTOP_SESSION_CONNECTOR_H_ |
| OLD | NEW |