#include "remoting/host/linux/clipboard_portal_injector.h"
#include <gio/gio.h>
#include <gio/gunixfdlist.h>
#include <stdio.h>
#include <unistd.h>
#include "base/files/file_util.h"
#include "base/files/scoped_file.h"
#include "base/strings/string_util.h"
#include "remoting/base/constants.h"
#include "remoting/base/logging.h"
#include "third_party/webrtc/modules/portal/scoped_glib.h"
#include "third_party/webrtc/modules/portal/xdg_desktop_portal_utils.h"
namespace remoting::xdg_portal {
namespace {
constexpr char kClipboardInterfaceName[] = …;
constexpr char kPortalMimeTypeTextUtf8[] = …;
Scoped;
kDesktopBusName;
kDesktopObjectPath;
SessionDetails;
void UnsubscribeSignalHandler(GDBusConnection* connection, guint& signal_id) { … }
static std::string TranslateMimeTypeForPortal(std::string mime_type) { … }
}
ClipboardPortalInjector::ClipboardPortalInjector(
ClipboardChangedCallback clipboard_changed_back)
: … { … }
ClipboardPortalInjector::~ClipboardPortalInjector() { … }
void ClipboardPortalInjector::UnsubscribeSignalHandlers() { … }
void ClipboardPortalInjector::SetSessionDetails(
const webrtc::xdg_portal::SessionDetails& session_details) { … }
void ClipboardPortalInjector::SetSelection(std::string mime_type,
std::string data) { … }
void ClipboardPortalInjector::OnSetSelectionCallback(GObject* object,
GAsyncResult* result,
gpointer user_data) { … }
void ClipboardPortalInjector::SelectionWrite(const uint serial) { … }
void ClipboardPortalInjector::OnSelectionWriteCallback(GObject* object,
GAsyncResult* result,
gpointer user_data) { … }
void ClipboardPortalInjector::SelectionWriteDone(const uint serial,
const gboolean success) { … }
void ClipboardPortalInjector::OnSelectionWriteDoneCallback(GObject* object,
GAsyncResult* result,
gpointer user_data) { … }
void ClipboardPortalInjector::SelectionRead(std::string mime_type) { … }
void ClipboardPortalInjector::OnSelectionReadCallback(GObject* object,
GAsyncResult* result,
gpointer user_data) { … }
void ClipboardPortalInjector::SubscribeClipboardSignals() { … }
void ClipboardPortalInjector::OnSelectionTransferSignal(
GDBusConnection* connection,
const char* sender_name,
const char* object_path,
const char* interface_name,
const char* signal_name,
GVariant* parameters,
gpointer user_data) { … }
void ClipboardPortalInjector::OnSelectionOwnerChangedSignal(
GDBusConnection* connection,
const char* sender_name,
const char* object_path,
const char* interface_name,
const char* signal_name,
GVariant* parameters,
gpointer user_data) { … }
}