Chromium Code Reviews| 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 23 matching lines...) Expand all Loading... | |
| 34 // A variant of desktop environment integrating with the desktop by means of | 34 // A variant of desktop environment integrating with the desktop by means of |
| 35 // a helper process and talking to that process via IPC. | 35 // a helper process and talking to that process via IPC. |
| 36 class IpcDesktopEnvironment : public DesktopEnvironment { | 36 class IpcDesktopEnvironment : public DesktopEnvironment { |
| 37 public: | 37 public: |
| 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, | |
| 45 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, | 44 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
| 46 base::WeakPtr<ClientSessionControl> client_session_control, | 45 base::WeakPtr<ClientSessionControl> client_session_control, |
| 47 base::WeakPtr<DesktopSessionConnector> desktop_session_connector, | 46 base::WeakPtr<DesktopSessionConnector> desktop_session_connector, |
| 48 bool virtual_terminal, | 47 bool virtual_terminal, |
| 49 bool supports_touch_events); | 48 bool supports_touch_events); |
| 50 ~IpcDesktopEnvironment() override; | 49 ~IpcDesktopEnvironment() override; |
| 51 | 50 |
| 52 // DesktopEnvironment implementation. | 51 // DesktopEnvironment implementation. |
| 53 scoped_ptr<AudioCapturer> CreateAudioCapturer() override; | 52 scoped_ptr<AudioCapturer> CreateAudioCapturer() override; |
| 54 scoped_ptr<InputInjector> CreateInputInjector() override; | 53 scoped_ptr<InputInjector> CreateInputInjector() override; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 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, | |
| 81 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, | 79 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
| 82 IPC::Sender* daemon_channel); | 80 IPC::Sender* daemon_channel); |
| 83 ~IpcDesktopEnvironmentFactory() override; | 81 ~IpcDesktopEnvironmentFactory() override; |
| 84 | 82 |
| 85 // DesktopEnvironmentFactory implementation. | 83 // DesktopEnvironmentFactory implementation. |
| 86 scoped_ptr<DesktopEnvironment> Create( | 84 scoped_ptr<DesktopEnvironment> Create( |
| 87 base::WeakPtr<ClientSessionControl> client_session_control) override; | 85 base::WeakPtr<ClientSessionControl> client_session_control) override; |
| 88 void SetEnableCurtaining(bool enable) override; | 86 void SetEnableCurtaining(bool enable) override; |
| 89 bool SupportsAudioCapture() const override; | 87 bool SupportsAudioCapture() const override; |
| 90 | 88 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 107 } | 105 } |
| 108 | 106 |
| 109 private: | 107 private: |
| 110 // Used to run the audio capturer. | 108 // Used to run the audio capturer. |
| 111 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; | 109 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; |
| 112 | 110 |
| 113 // Task runner on which methods of DesktopEnvironmentFactory interface should | 111 // Task runner on which methods of DesktopEnvironmentFactory interface should |
| 114 // be called. | 112 // be called. |
| 115 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; | 113 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; |
| 116 | 114 |
| 117 // Used to run the video capturer. | |
| 118 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_; | |
| 119 | |
| 120 // Task runner used for running background I/O. | 115 // Task runner used for running background I/O. |
| 121 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 116 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| 122 | 117 |
| 123 // True if curtain mode is enabled. | 118 // True if curtain mode is enabled. |
| 124 bool curtain_enabled_; | 119 bool curtain_enabled_ = false; |
| 125 | 120 |
| 126 // IPC channel connected to the daemon process. | 121 // IPC channel connected to the daemon process. |
| 127 IPC::Sender* daemon_channel_; | 122 IPC::Sender* daemon_channel_; |
| 128 | 123 |
| 129 // List of DesktopEnvironment instances we've told the daemon process about. | 124 // List of DesktopEnvironment instances we've told the daemon process about. |
| 130 typedef std::map<int, DesktopSessionProxy*> ActiveConnectionsList; | 125 typedef std::map<int, DesktopSessionProxy*> ActiveConnectionsList; |
| 131 ActiveConnectionsList active_connections_; | 126 ActiveConnectionsList active_connections_; |
| 132 | 127 |
| 133 // Next desktop session ID. IDs are allocated sequentially starting from 0. | 128 // Next desktop session ID. IDs are allocated sequentially starting from 0. |
| 134 // This gives us more than 67 years of unique IDs assuming a new ID is | 129 // This gives us more than 67 years of unique IDs assuming a new ID is |
| 135 // allocated every second. | 130 // allocated every second. |
| 136 int next_id_; | 131 int next_id_ = 0; |
| 132 | |
| 133 // If true then the newly Create()ed desktop environments support touch | |
| 134 // events. | |
|
joedow
2016/02/05 21:39:26
nit: Reword: Defines whether desktop environments
Sergey Ulanov
2016/02/05 21:51:20
Done. Note that this is no a new comment. I just r
| |
| 135 bool supports_touch_events_ = false; | |
| 137 | 136 |
| 138 // Factory for weak pointers to DesktopSessionConnector interface. | 137 // Factory for weak pointers to DesktopSessionConnector interface. |
| 139 base::WeakPtrFactory<DesktopSessionConnector> connector_factory_; | 138 base::WeakPtrFactory<DesktopSessionConnector> connector_factory_; |
| 140 | 139 |
| 141 // If true then the newly Create()ed desktop environments support touch | |
| 142 // events. | |
| 143 bool supports_touch_events_; | |
| 144 | |
| 145 DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironmentFactory); | 140 DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironmentFactory); |
| 146 }; | 141 }; |
| 147 | 142 |
| 148 } // namespace remoting | 143 } // namespace remoting |
| 149 | 144 |
| 150 #endif // REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_ | 145 #endif // REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_ |
| OLD | NEW |