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 28 matching lines...) Expand all Loading... |
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 virtual ~IpcDesktopEnvironment(); | 49 ~IpcDesktopEnvironment() override; |
50 | 50 |
51 // DesktopEnvironment implementation. | 51 // DesktopEnvironment implementation. |
52 virtual scoped_ptr<AudioCapturer> CreateAudioCapturer() override; | 52 scoped_ptr<AudioCapturer> CreateAudioCapturer() override; |
53 virtual scoped_ptr<InputInjector> CreateInputInjector() override; | 53 scoped_ptr<InputInjector> CreateInputInjector() override; |
54 virtual scoped_ptr<ScreenControls> CreateScreenControls() override; | 54 scoped_ptr<ScreenControls> CreateScreenControls() override; |
55 virtual scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer() override; | 55 scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer() override; |
56 virtual scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor() | 56 scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor() override; |
57 override; | 57 std::string GetCapabilities() const override; |
58 virtual std::string GetCapabilities() const override; | 58 void SetCapabilities(const std::string& capabilities) override; |
59 virtual void SetCapabilities(const std::string& capabilities) override; | 59 scoped_ptr<GnubbyAuthHandler> CreateGnubbyAuthHandler( |
60 virtual scoped_ptr<GnubbyAuthHandler> CreateGnubbyAuthHandler( | |
61 protocol::ClientStub* client_stub) override; | 60 protocol::ClientStub* client_stub) override; |
62 | 61 |
63 private: | 62 private: |
64 scoped_refptr<DesktopSessionProxy> desktop_session_proxy_; | 63 scoped_refptr<DesktopSessionProxy> desktop_session_proxy_; |
65 | 64 |
66 DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironment); | 65 DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironment); |
67 }; | 66 }; |
68 | 67 |
69 // Used to create IpcDesktopEnvironment objects integrating with the desktop via | 68 // Used to create IpcDesktopEnvironment objects integrating with the desktop via |
70 // a helper process and talking to that process via IPC. | 69 // a helper process and talking to that process via IPC. |
71 class IpcDesktopEnvironmentFactory | 70 class IpcDesktopEnvironmentFactory |
72 : public DesktopEnvironmentFactory, | 71 : public DesktopEnvironmentFactory, |
73 public DesktopSessionConnector { | 72 public DesktopSessionConnector { |
74 public: | 73 public: |
75 // Passes a reference to the IPC channel connected to the daemon process and | 74 // Passes a reference to the IPC channel connected to the daemon process and |
76 // relevant task runners. |daemon_channel| must outlive this object. | 75 // relevant task runners. |daemon_channel| must outlive this object. |
77 IpcDesktopEnvironmentFactory( | 76 IpcDesktopEnvironmentFactory( |
78 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, | 77 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, |
79 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 78 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
80 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, | 79 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, |
81 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, | 80 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
82 IPC::Sender* daemon_channel); | 81 IPC::Sender* daemon_channel); |
83 virtual ~IpcDesktopEnvironmentFactory(); | 82 ~IpcDesktopEnvironmentFactory() override; |
84 | 83 |
85 // DesktopEnvironmentFactory implementation. | 84 // DesktopEnvironmentFactory implementation. |
86 virtual scoped_ptr<DesktopEnvironment> Create( | 85 scoped_ptr<DesktopEnvironment> Create( |
87 base::WeakPtr<ClientSessionControl> client_session_control) override; | 86 base::WeakPtr<ClientSessionControl> client_session_control) override; |
88 virtual void SetEnableCurtaining(bool enable) override; | 87 void SetEnableCurtaining(bool enable) override; |
89 virtual bool SupportsAudioCapture() const override; | 88 bool SupportsAudioCapture() const override; |
90 | 89 |
91 // DesktopSessionConnector implementation. | 90 // DesktopSessionConnector implementation. |
92 virtual void ConnectTerminal( | 91 void ConnectTerminal(DesktopSessionProxy* desktop_session_proxy, |
93 DesktopSessionProxy* desktop_session_proxy, | 92 const ScreenResolution& resolution, |
94 const ScreenResolution& resolution, | 93 bool virtual_terminal) override; |
95 bool virtual_terminal) override; | 94 void DisconnectTerminal(DesktopSessionProxy* desktop_session_proxy) override; |
96 virtual void DisconnectTerminal( | 95 void SetScreenResolution(DesktopSessionProxy* desktop_session_proxy, |
97 DesktopSessionProxy* desktop_session_proxy) override; | 96 const ScreenResolution& resolution) override; |
98 virtual void SetScreenResolution( | 97 void OnDesktopSessionAgentAttached( |
99 DesktopSessionProxy* desktop_session_proxy, | |
100 const ScreenResolution& resolution) override; | |
101 virtual void OnDesktopSessionAgentAttached( | |
102 int terminal_id, | 98 int terminal_id, |
103 base::ProcessHandle desktop_process, | 99 base::ProcessHandle desktop_process, |
104 IPC::PlatformFileForTransit desktop_pipe) override; | 100 IPC::PlatformFileForTransit desktop_pipe) override; |
105 virtual void OnTerminalDisconnected(int terminal_id) override; | 101 void OnTerminalDisconnected(int terminal_id) override; |
106 | 102 |
107 private: | 103 private: |
108 // Used to run the audio capturer. | 104 // Used to run the audio capturer. |
109 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; | 105 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; |
110 | 106 |
111 // Task runner on which methods of DesktopEnvironmentFactory interface should | 107 // Task runner on which methods of DesktopEnvironmentFactory interface should |
112 // be called. | 108 // be called. |
113 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; | 109 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; |
114 | 110 |
115 // Used to run the video capturer. | 111 // Used to run the video capturer. |
(...skipping 19 matching lines...) Expand all Loading... |
135 | 131 |
136 // Factory for weak pointers to DesktopSessionConnector interface. | 132 // Factory for weak pointers to DesktopSessionConnector interface. |
137 base::WeakPtrFactory<DesktopSessionConnector> connector_factory_; | 133 base::WeakPtrFactory<DesktopSessionConnector> connector_factory_; |
138 | 134 |
139 DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironmentFactory); | 135 DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironmentFactory); |
140 }; | 136 }; |
141 | 137 |
142 } // namespace remoting | 138 } // namespace remoting |
143 | 139 |
144 #endif // REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_ | 140 #endif // REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_ |
OLD | NEW |