#include "remoting/host/ipc_desktop_environment.h"
#include <utility>
#include "base/compiler_specific.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/process/process_handle.h"
#include "base/task/single_thread_task_runner.h"
#include "build/build_config.h"
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
#include "remoting/host/action_executor.h"
#include "remoting/host/active_display_monitor.h"
#include "remoting/host/audio_capturer.h"
#include "remoting/host/base/screen_controls.h"
#include "remoting/host/client_session_control.h"
#include "remoting/host/desktop_display_info_monitor.h"
#include "remoting/host/desktop_session.h"
#include "remoting/host/desktop_session_proxy.h"
#include "remoting/host/file_transfer/file_operations.h"
#include "remoting/host/input_injector.h"
#include "remoting/host/keyboard_layout_monitor.h"
#include "remoting/host/remote_open_url/url_forwarder_configurator.h"
#include "remoting/protocol/desktop_capturer.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
#include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h"
namespace remoting {
IpcDesktopEnvironment::IpcDesktopEnvironment(
scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
base::WeakPtr<ClientSessionControl> client_session_control,
base::WeakPtr<ClientSessionEvents> client_session_events,
base::WeakPtr<DesktopSessionConnector> desktop_session_connector,
const DesktopEnvironmentOptions& options)
: … { … }
IpcDesktopEnvironment::~IpcDesktopEnvironment() = default;
std::unique_ptr<ActionExecutor> IpcDesktopEnvironment::CreateActionExecutor() { … }
std::unique_ptr<AudioCapturer> IpcDesktopEnvironment::CreateAudioCapturer() { … }
std::unique_ptr<InputInjector> IpcDesktopEnvironment::CreateInputInjector() { … }
std::unique_ptr<ScreenControls> IpcDesktopEnvironment::CreateScreenControls() { … }
DesktopDisplayInfoMonitor* IpcDesktopEnvironment::GetDisplayInfoMonitor() { … }
std::unique_ptr<webrtc::MouseCursorMonitor>
IpcDesktopEnvironment::CreateMouseCursorMonitor() { … }
std::unique_ptr<KeyboardLayoutMonitor>
IpcDesktopEnvironment::CreateKeyboardLayoutMonitor(
base::RepeatingCallback<void(const protocol::KeyboardLayout&)> callback) { … }
std::unique_ptr<ActiveDisplayMonitor>
IpcDesktopEnvironment::CreateActiveDisplayMonitor(
ActiveDisplayMonitor::Callback callback) { … }
std::unique_ptr<DesktopCapturer> IpcDesktopEnvironment::CreateVideoCapturer(
webrtc::ScreenId id) { … }
std::unique_ptr<FileOperations> IpcDesktopEnvironment::CreateFileOperations() { … }
std::unique_ptr<UrlForwarderConfigurator>
IpcDesktopEnvironment::CreateUrlForwarderConfigurator() { … }
std::string IpcDesktopEnvironment::GetCapabilities() const { … }
void IpcDesktopEnvironment::SetCapabilities(const std::string& capabilities) { … }
uint32_t IpcDesktopEnvironment::GetDesktopSessionId() const { … }
std::unique_ptr<RemoteWebAuthnStateChangeNotifier>
IpcDesktopEnvironment::CreateRemoteWebAuthnStateChangeNotifier() { … }
IpcDesktopEnvironmentFactory::IpcDesktopEnvironmentFactory(
scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
mojo::AssociatedRemote<mojom::DesktopSessionManager> remote)
: … { … }
IpcDesktopEnvironmentFactory::~IpcDesktopEnvironmentFactory() { … }
std::unique_ptr<DesktopEnvironment> IpcDesktopEnvironmentFactory::Create(
base::WeakPtr<ClientSessionControl> client_session_control,
base::WeakPtr<ClientSessionEvents> client_session_events,
const DesktopEnvironmentOptions& options) { … }
bool IpcDesktopEnvironmentFactory::SupportsAudioCapture() const { … }
void IpcDesktopEnvironmentFactory::ConnectTerminal(
DesktopSessionProxy* desktop_session_proxy,
const ScreenResolution& resolution,
bool virtual_terminal) { … }
void IpcDesktopEnvironmentFactory::DisconnectTerminal(
DesktopSessionProxy* desktop_session_proxy) { … }
void IpcDesktopEnvironmentFactory::SetScreenResolution(
DesktopSessionProxy* desktop_session_proxy,
const ScreenResolution& resolution) { … }
bool IpcDesktopEnvironmentFactory::BindConnectionEventsReceiver(
mojo::ScopedInterfaceEndpointHandle handle) { … }
void IpcDesktopEnvironmentFactory::OnDesktopSessionAgentAttached(
int terminal_id,
int session_id,
mojo::ScopedMessagePipeHandle desktop_pipe) { … }
void IpcDesktopEnvironmentFactory::OnTerminalDisconnected(int terminal_id) { … }
}