summaryrefslogtreecommitdiff
path: root/chromium/content/browser/renderer_host/clipboard_host_impl.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-09-01 11:08:40 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-10-01 12:16:21 +0000
commit03c549e0392f92c02536d3f86d5e1d8dfa3435ac (patch)
treefe49d170a929b34ba82cd10db1a0bd8e3760fa4b /chromium/content/browser/renderer_host/clipboard_host_impl.h
parent5d013f5804a0d91fcf6c626b2d6fb6eca5c845b0 (diff)
downloadqtwebengine-chromium-03c549e0392f92c02536d3f86d5e1d8dfa3435ac.tar.gz
BASELINE: Update Chromium to 91.0.4472.160
Change-Id: I0def1f08a2412aeed79a9ab95dd50eb5c3f65f31 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/content/browser/renderer_host/clipboard_host_impl.h')
-rw-r--r--chromium/content/browser/renderer_host/clipboard_host_impl.h39
1 files changed, 29 insertions, 10 deletions
diff --git a/chromium/content/browser/renderer_host/clipboard_host_impl.h b/chromium/content/browser/renderer_host/clipboard_host_impl.h
index 9a98bb282b4..fd36e6561c0 100644
--- a/chromium/content/browser/renderer_host/clipboard_host_impl.h
+++ b/chromium/content/browser/renderer_host/clipboard_host_impl.h
@@ -93,9 +93,18 @@ class CONTENT_EXPORT ClipboardHostImpl : public blink::mojom::ClipboardHost {
explicit ClipboardHostImpl(RenderFrameHost* render_frame_host);
+ // Performs a check to see if pasting `data` is allowed by data transfer
+ // policies and invokes PasteIfPolicyAllowedCallback upon completion.
+ // PerformPasteIfContentAllowed maybe be invoked immediately if the policy
+ // controller doesn't exist.
+ void PasteIfPolicyAllowed(ui::ClipboardBuffer clipboard_buffer,
+ const ui::ClipboardFormatType& data_type,
+ std::string data,
+ IsClipboardPasteContentAllowedCallback callback);
+
// Performs a check to see if pasting |data| is allowed and invokes |callback|
- // upon completion. |callback| maybe be invoked immediately if the data has
- // already been checked. |data| and |seqno| should corresponds to the same
+ // upon completion. |callback| may be invoked immediately if the data has
+ // already been checked. |data| and |seqno| should corresponds to the same
// clipboard data.
void PerformPasteIfContentAllowed(
uint64_t seqno,
@@ -110,7 +119,7 @@ class CONTENT_EXPORT ClipboardHostImpl : public blink::mojom::ClipboardHost {
// - it is too old
void CleanupObsoleteRequests();
- // Completion callback of PerformPasteIfContentAllowed(). Sets the allowed
+ // Completion callback of PerformPasteIfContentAllowed(). Sets the allowed
// status for the clipboard data corresponding to sequence number |seqno|.
void FinishPasteIfContentAllowed(uint64_t seqno,
ClipboardPasteContentAllowed allowed);
@@ -155,20 +164,20 @@ class CONTENT_EXPORT ClipboardHostImpl : public blink::mojom::ClipboardHost {
void ReadFiles(ui::ClipboardBuffer clipboard_buffer,
ReadFilesCallback callback) override;
void ReadCustomData(ui::ClipboardBuffer clipboard_buffer,
- const base::string16& type,
+ const std::u16string& type,
ReadCustomDataCallback callback) override;
- void WriteText(const base::string16& text) override;
- void WriteHtml(const base::string16& markup, const GURL& url) override;
- void WriteSvg(const base::string16& markup) override;
+ void WriteText(const std::u16string& text) override;
+ void WriteHtml(const std::u16string& markup, const GURL& url) override;
+ void WriteSvg(const std::u16string& markup) override;
void WriteSmartPasteMarker() override;
void WriteCustomData(
- const base::flat_map<base::string16, base::string16>& data) override;
+ const base::flat_map<std::u16string, std::u16string>& data) override;
void WriteBookmark(const std::string& url,
- const base::string16& title) override;
+ const std::u16string& title) override;
void WriteImage(const SkBitmap& unsafe_bitmap) override;
void CommitWrite() override;
#if defined(OS_MAC)
- void WriteStringToFindPboard(const base::string16& text) override;
+ void WriteStringToFindPboard(const std::u16string& text) override;
#endif
// Called by PerformPasteIfContentAllowed() when an is allowed request is
@@ -178,6 +187,16 @@ class CONTENT_EXPORT ClipboardHostImpl : public blink::mojom::ClipboardHost {
const ui::ClipboardFormatType& data_type,
std::string data);
+ // Completion callback of PasteIfPolicyAllowed. If `is_allowed` is set to
+ // true, PerformPasteIfContentAllowed will be invoked. Otherwise `callback`
+ // will be invoked immediately to cancel the paste.
+ void PasteIfPolicyAllowedCallback(
+ ui::ClipboardBuffer clipboard_buffer,
+ const ui::ClipboardFormatType& data_type,
+ std::string data,
+ IsClipboardPasteContentAllowedCallback callback,
+ bool is_allowed);
+
void OnReadImage(ui::ClipboardBuffer clipboard_buffer,
ReadImageCallback callback,
const SkBitmap& bitmap);