Revert of Sandbox html_viewer on Linux. (patchset #6 id:100001 of https://codereview...
[chromium-blink-merge.git] / remoting / host / desktop_session_connector.h
blob84fc42d46f3c078cd4cf191c38303244c47c1e85
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
3 // found in the LICENSE file.
5 #ifndef REMOTING_HOST_DESKTOP_SESSION_CONNECTOR_H_
6 #define REMOTING_HOST_DESKTOP_SESSION_CONNECTOR_H_
8 #include "base/basictypes.h"
9 #include "base/process/process.h"
10 #include "ipc/ipc_platform_file.h"
12 namespace remoting {
14 class DesktopSessionProxy;
15 class ScreenResolution;
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).
19 class DesktopSessionConnector {
20 public:
21 DesktopSessionConnector() {}
22 virtual ~DesktopSessionConnector() {}
24 // Requests the daemon process to create a desktop session and associates
25 // |desktop_session_proxy| with it. |desktop_session_proxy| must be
26 // disconnected from the desktop session (see DisconnectTerminal()) before it
27 // can be deleted.
28 virtual void ConnectTerminal(
29 DesktopSessionProxy* desktop_session_proxy,
30 const ScreenResolution& resolution,
31 bool virtual_terminal) = 0;
33 // Requests the daemon process disconnect |desktop_session_proxy| from
34 // the associated desktop session.
35 virtual void DisconnectTerminal(
36 DesktopSessionProxy* desktop_session_proxy) = 0;
38 // Changes the screen resolution of the desktop session.
39 virtual void SetScreenResolution(
40 DesktopSessionProxy* desktop_session_proxy,
41 const ScreenResolution& resolution) = 0;
43 // Notifies the network process that |terminal_id| is now attached to
44 // a desktop integration process. |desktop_process_handle| specifies the
45 // process handle. |desktop_pipe| is the client end of the pipe opened by the
46 // desktop process.
47 virtual void OnDesktopSessionAgentAttached(
48 int terminal_id,
49 base::ProcessHandle desktop_process_handle,
50 IPC::PlatformFileForTransit desktop_pipe) = 0;
52 // Notifies the network process that the daemon has disconnected the desktop
53 // session from the associated desktop environment.
54 virtual void OnTerminalDisconnected(int terminal_id) = 0;
56 private:
57 DISALLOW_COPY_AND_ASSIGN(DesktopSessionConnector);
60 } // namespace remoting
62 #endif // REMOTING_HOST_DESKTOP_SESSION_CONNECTOR_H_