#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "content/test/mock_clipboard_host.h"
#include <vector>
#include "base/containers/contains.h"
#include "base/notreached.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "mojo/public/cpp/base/big_buffer.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/clipboard/clipboard_constants.h"
#include "ui/gfx/codec/png_codec.h"
namespace content {
MockClipboardHost::MockClipboardHost() = default;
MockClipboardHost::~MockClipboardHost() = default;
void MockClipboardHost::Bind(
mojo::PendingReceiver<blink::mojom::ClipboardHost> receiver) { … }
void MockClipboardHost::Reset() { … }
void MockClipboardHost::GetSequenceNumber(ui::ClipboardBuffer clipboard_buffer,
GetSequenceNumberCallback callback) { … }
std::vector<std::u16string> MockClipboardHost::ReadStandardFormatNames() { … }
void MockClipboardHost::ReadAvailableTypes(
ui::ClipboardBuffer clipboard_buffer,
ReadAvailableTypesCallback callback) { … }
void MockClipboardHost::IsFormatAvailable(blink::mojom::ClipboardFormat format,
ui::ClipboardBuffer clipboard_buffer,
IsFormatAvailableCallback callback) { … }
void MockClipboardHost::ReadText(ui::ClipboardBuffer clipboard_buffer,
ReadTextCallback callback) { … }
void MockClipboardHost::ReadHtml(ui::ClipboardBuffer clipboard_buffer,
ReadHtmlCallback callback) { … }
void MockClipboardHost::ReadSvg(ui::ClipboardBuffer clipboard_buffer,
ReadSvgCallback callback) { … }
void MockClipboardHost::ReadRtf(ui::ClipboardBuffer clipboard_buffer,
ReadRtfCallback callback) { … }
void MockClipboardHost::ReadPng(ui::ClipboardBuffer clipboard_buffer,
ReadPngCallback callback) { … }
void MockClipboardHost::ReadFiles(ui::ClipboardBuffer clipboard_buffer,
ReadFilesCallback callback) { … }
void MockClipboardHost::ReadDataTransferCustomData(
ui::ClipboardBuffer clipboard_buffer,
const std::u16string& type,
ReadDataTransferCustomDataCallback callback) { … }
void MockClipboardHost::WriteText(const std::u16string& text) { … }
void MockClipboardHost::WriteHtml(const std::u16string& markup,
const GURL& url) { … }
void MockClipboardHost::WriteSvg(const std::u16string& markup) { … }
void MockClipboardHost::WriteSmartPasteMarker() { … }
void MockClipboardHost::WriteDataTransferCustomData(
const base::flat_map<std::u16string, std::u16string>& data) { … }
void MockClipboardHost::WriteBookmark(const std::string& url,
const std::u16string& title) { … }
void MockClipboardHost::WriteImage(const SkBitmap& bitmap) { … }
void MockClipboardHost::CommitWrite() { … }
void MockClipboardHost::ReadAvailableCustomAndStandardFormats(
ReadAvailableCustomAndStandardFormatsCallback callback) { … }
void MockClipboardHost::ReadUnsanitizedCustomFormat(
const std::u16string& format,
ReadUnsanitizedCustomFormatCallback callback) { … }
void MockClipboardHost::WriteUnsanitizedCustomFormat(
const std::u16string& format,
mojo_base::BigBuffer data) { … }
#if BUILDFLAG(IS_MAC)
void MockClipboardHost::WriteStringToFindPboard(const std::u16string& text) {}
#endif
}