#include "remoting/host/linux/remote_desktop_portal.h"
#include <glib-object.h>
#include <utility>
#include "base/check.h"
#include "base/rand_util.h"
#include "base/sequence_checker.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
#include "remoting/base/logging.h"
#include "remoting/host/linux/clipboard_portal.h"
#include "remoting/host/linux/wayland_manager.h"
#include "third_party/webrtc/modules/portal/xdg_desktop_portal_utils.h"
namespace remoting::xdg_portal {
namespace {
constexpr char kRemoteDesktopInterfaceName[] = …;
constexpr char kPortalPrefix[] = …;
Scoped;
kDesktopObjectPath;
kSessionInterfaceName;
RequestResponse;
void UnsubscribeSignalHandler(GDBusConnection* connection, guint& signal_id) { … }
}
RemoteDesktopPortal::RemoteDesktopPortal(
webrtc::ScreenCastPortal::PortalNotifier* notifier,
bool prefer_cursor_embedded)
: … { … }
RemoteDesktopPortal::~RemoteDesktopPortal() { … }
void RemoteDesktopPortal::Stop() { … }
void RemoteDesktopPortal::UnsubscribeSignalHandlers() { … }
void RemoteDesktopPortal::Start() { … }
uint32_t RemoteDesktopPortal::pipewire_stream_node_id() { … }
void RemoteDesktopPortal::OnProxyRequested(GObject* gobject,
GAsyncResult* result,
gpointer user_data) { … }
void RemoteDesktopPortal::OnScreenCastPortalProxyRequested(GObject* ,
GAsyncResult* result,
gpointer user_data) { … }
void RemoteDesktopPortal::RequestSession(GDBusProxy* proxy) { … }
void RemoteDesktopPortal::OnSessionRequested(GDBusProxy* proxy,
GAsyncResult* result,
gpointer user_data) { … }
void RemoteDesktopPortal::OnDevicesRequested(GObject* object,
GAsyncResult* result,
gpointer user_data) { … }
void RemoteDesktopPortal::RequestSources() { … }
void RemoteDesktopPortal::RequestClipboard() { … }
void RemoteDesktopPortal::OnDevicesRequestImpl(GDBusConnection* connection,
const gchar* sender_name,
const gchar* object_path,
const gchar* interface_name,
const gchar* signal_name,
GVariant* parameters,
gpointer user_data) { … }
void RemoteDesktopPortal::SelectDevices() { … }
void RemoteDesktopPortal::OnSessionRequestResponseSignal(
GDBusConnection* connection,
const char* sender_name,
const char* object_path,
const char* interface_name,
const char* signal_name,
GVariant* parameters,
gpointer user_data) { … }
void RemoteDesktopPortal::OnSessionClosedSignal(GDBusConnection* connection,
const char* sender_name,
const char* object_path,
const char* interface_name,
const char* signal_name,
GVariant* parameters,
gpointer user_data) { … }
void RemoteDesktopPortal::OnSourcesRequestResponseSignal(
GDBusConnection* connection,
const char* sender_name,
const char* object_path,
const char* interface_name,
const char* signal_name,
GVariant* parameters,
gpointer user_data) { … }
void RemoteDesktopPortal::StartRequest() { … }
void RemoteDesktopPortal::OnStartRequested(GDBusProxy* proxy,
GAsyncResult* result,
gpointer user_data) { … }
void RemoteDesktopPortal::OnStartRequestResponseSignal(
GDBusConnection* connection,
const char* sender_name,
const char* object_path,
const char* interface_name,
const char* signal_name,
GVariant* parameters,
gpointer user_data) { … }
void RemoteDesktopPortal::OnPortalDone(RequestResponse result) { … }
webrtc::xdg_portal::SessionDetails RemoteDesktopPortal::GetSessionDetails() { … }
void RemoteDesktopPortal::OnScreenCastRequestResult(RequestResponse result,
uint32_t stream_node_id,
int fd) { … }
void RemoteDesktopPortal::OnScreenCastSessionClosed() { … }
void RemoteDesktopPortal::OnClipboardPortalDone(
webrtc::xdg_portal::RequestResponse result) { … }
}