Avi Drissman | d6cdf9b | 2022-09-15 19:52:53 | [diff] [blame] | 1 | // Copyright 2012 The Chromium Authors |
[email protected] | da457fc | 2013-03-14 16:32:12 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef REMOTING_HOST_ME2ME_DESKTOP_ENVIRONMENT_H_ |
| 6 | #define REMOTING_HOST_ME2ME_DESKTOP_ENVIRONMENT_H_ |
| 7 | |
Patrick Monette | 643cdf6 | 2021-10-15 19:13:42 | [diff] [blame] | 8 | #include "base/task/single_thread_task_runner.h" |
[email protected] | da457fc | 2013-03-14 16:32:12 | [diff] [blame] | 9 | #include "remoting/host/basic_desktop_environment.h" |
| 10 | |
| 11 | namespace remoting { |
| 12 | |
[email protected] | 96361d0 | 2013-05-08 18:26:18 | [diff] [blame] | 13 | class CurtainMode; |
[email protected] | ac115ce | 2013-04-24 20:44:38 | [diff] [blame] | 14 | class HostWindow; |
| 15 | class LocalInputMonitor; |
| 16 | |
[email protected] | da457fc | 2013-03-14 16:32:12 | [diff] [blame] | 17 | // Same as BasicDesktopEnvironment but supports desktop resizing and X DAMAGE |
| 18 | // notifications on Linux. |
| 19 | class Me2MeDesktopEnvironment : public BasicDesktopEnvironment { |
| 20 | public: |
Peter Boström | e9178e4 | 2021-09-22 18:11:49 | [diff] [blame] | 21 | Me2MeDesktopEnvironment(const Me2MeDesktopEnvironment&) = delete; |
| 22 | Me2MeDesktopEnvironment& operator=(const Me2MeDesktopEnvironment&) = delete; |
| 23 | |
dcheng | 562aba5 | 2014-10-21 12:30:14 | [diff] [blame] | 24 | ~Me2MeDesktopEnvironment() override; |
[email protected] | da457fc | 2013-03-14 16:32:12 | [diff] [blame] | 25 | |
| 26 | // DesktopEnvironment interface. |
Joe Downing | 505ae0d0 | 2018-10-17 17:47:30 | [diff] [blame] | 27 | std::unique_ptr<ActionExecutor> CreateActionExecutor() override; |
dcheng | 0765c49 | 2016-04-06 22:41:53 | [diff] [blame] | 28 | std::unique_ptr<ScreenControls> CreateScreenControls() override; |
dcheng | 562aba5 | 2014-10-21 12:30:14 | [diff] [blame] | 29 | std::string GetCapabilities() const override; |
[email protected] | da457fc | 2013-03-14 16:32:12 | [diff] [blame] | 30 | |
| 31 | protected: |
| 32 | friend class Me2MeDesktopEnvironmentFactory; |
[email protected] | 231316a | 2013-03-25 06:01:12 | [diff] [blame] | 33 | Me2MeDesktopEnvironment( |
| 34 | scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
sergeyu | 85df3c48 | 2016-02-15 05:59:08 | [diff] [blame] | 35 | scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner, |
[email protected] | 231316a | 2013-03-25 06:01:12 | [diff] [blame] | 36 | scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
zijiehe | 4aa6ea4 | 2016-11-12 01:28:16 | [diff] [blame] | 37 | scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
Gary Kacmarcik | a7e33e4 | 2019-02-22 19:23:28 | [diff] [blame] | 38 | base::WeakPtr<ClientSessionControl> client_session_control, |
zijiehe | 4aa6ea4 | 2016-11-12 01:28:16 | [diff] [blame] | 39 | const DesktopEnvironmentOptions& options); |
[email protected] | 96361d0 | 2013-05-08 18:26:18 | [diff] [blame] | 40 | |
| 41 | // Initializes security features of the desktop environment (the curtain mode |
| 42 | // and in-session UI). |
| 43 | bool InitializeSecurity( |
zijiehe | 4aa6ea4 | 2016-11-12 01:28:16 | [diff] [blame] | 44 | base::WeakPtr<ClientSessionControl> client_session_control); |
[email protected] | da457fc | 2013-03-14 16:32:12 | [diff] [blame] | 45 | |
| 46 | private: |
[email protected] | 96361d0 | 2013-05-08 18:26:18 | [diff] [blame] | 47 | // "Curtains" the session making sure it is disconnected from the local |
| 48 | // console. |
dcheng | 0765c49 | 2016-04-06 22:41:53 | [diff] [blame] | 49 | std::unique_ptr<CurtainMode> curtain_; |
[email protected] | 96361d0 | 2013-05-08 18:26:18 | [diff] [blame] | 50 | |
[email protected] | ac115ce | 2013-04-24 20:44:38 | [diff] [blame] | 51 | // Presents the disconnect window to the local user. |
dcheng | 0765c49 | 2016-04-06 22:41:53 | [diff] [blame] | 52 | std::unique_ptr<HostWindow> disconnect_window_; |
[email protected] | ac115ce | 2013-04-24 20:44:38 | [diff] [blame] | 53 | |
| 54 | // Notifies the client session about the local mouse movements. |
dcheng | 0765c49 | 2016-04-06 22:41:53 | [diff] [blame] | 55 | std::unique_ptr<LocalInputMonitor> local_input_monitor_; |
[email protected] | da457fc | 2013-03-14 16:32:12 | [diff] [blame] | 56 | }; |
| 57 | |
| 58 | // Used to create |Me2MeDesktopEnvironment| instances. |
| 59 | class Me2MeDesktopEnvironmentFactory : public BasicDesktopEnvironmentFactory { |
| 60 | public: |
[email protected] | 231316a | 2013-03-25 06:01:12 | [diff] [blame] | 61 | Me2MeDesktopEnvironmentFactory( |
| 62 | scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
sergeyu | 85df3c48 | 2016-02-15 05:59:08 | [diff] [blame] | 63 | scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner, |
[email protected] | 231316a | 2013-03-25 06:01:12 | [diff] [blame] | 64 | scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
Scott Violet | 9778dcd | 2019-06-20 21:59:37 | [diff] [blame] | 65 | scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
Peter Boström | e9178e4 | 2021-09-22 18:11:49 | [diff] [blame] | 66 | |
| 67 | Me2MeDesktopEnvironmentFactory(const Me2MeDesktopEnvironmentFactory&) = |
| 68 | delete; |
| 69 | Me2MeDesktopEnvironmentFactory& operator=( |
| 70 | const Me2MeDesktopEnvironmentFactory&) = delete; |
| 71 | |
dcheng | 562aba5 | 2014-10-21 12:30:14 | [diff] [blame] | 72 | ~Me2MeDesktopEnvironmentFactory() override; |
[email protected] | da457fc | 2013-03-14 16:32:12 | [diff] [blame] | 73 | |
| 74 | // DesktopEnvironmentFactory interface. |
dcheng | 0765c49 | 2016-04-06 22:41:53 | [diff] [blame] | 75 | std::unique_ptr<DesktopEnvironment> Create( |
zijiehe | 4aa6ea4 | 2016-11-12 01:28:16 | [diff] [blame] | 76 | base::WeakPtr<ClientSessionControl> client_session_control, |
Yuwei Huang | 3628aa5 | 2021-12-08 23:00:55 | [diff] [blame] | 77 | base::WeakPtr<ClientSessionEvents> client_session_events, |
zijiehe | 4aa6ea4 | 2016-11-12 01:28:16 | [diff] [blame] | 78 | const DesktopEnvironmentOptions& options) override; |
[email protected] | da457fc | 2013-03-14 16:32:12 | [diff] [blame] | 79 | }; |
| 80 | |
| 81 | } // namespace remoting |
| 82 | |
| 83 | #endif // REMOTING_HOST_ME2ME_DESKTOP_ENVIRONMENT_H_ |