Check if copy is allowed by policy before writing to clipboard
This CL wires up the ClipboardHostImpl to the CopyRestrictionService to
check that the CopyPreventionSettings policy allows copying data to the
clipboard from the current URL before performing the write. If the copy
is blocked, an explanation message is instead written to the clipboard
so that the user can understand why the copy operation failed. This
check is currently only performed on Text and HTML data.
Skip-Translation-Screenshots-Check because this string isn't displayed
in the UI. Instead, it may become visible to the user anywhere they
attempt to paste the data, including outside of Chromium.
Design doc for this feature: go/wp-copy-protection
Bug: 1269431
Change-Id: I172c97e970528c6654b8b4829ca7f0c0d49d7dd3
Skip-Translation-Screenshots-Check: True
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3307372
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Jungshik Shin <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Reviewed-by: Dominique Fauteux-Chapleau <[email protected]>
Commit-Queue: Anthony Vallée-Dubois <[email protected]>
Cr-Commit-Position: refs/heads/main@{#948667}
diff --git a/components/enterprise_strings.grdp b/components/enterprise_strings.grdp
index b628dfc..299c9f9e 100644
--- a/components/enterprise_strings.grdp
+++ b/components/enterprise_strings.grdp
@@ -6,4 +6,8 @@
<message name="IDS_ENTERPRISE_COPY_PREVENTION_DISABLE_CONTAINS_WILDCARD_ERROR" desc="Message indicating that the supplied value for the CopyPreventionSettings policy contains the wildcard character ('*') in the disable list, which is equivalent to disabling the policy completely">
Ignored because the disable list contains a pattern equal to '*', which is equivalent to disabling the policy.
</message>
+
+ <message name="IDS_ENTERPRISE_COPY_PREVENTION_WARNING_MESSAGE" desc="Message inserted into the clipboard instead of the intended data, when that data was blocked from being copied by the CopyPreventionSettings policy. This message will be visible to the user when they attempt to paste into any UI element (perhaps even outside of Chome) that supports displaying text.">
+ Your admin has prohibited this data from being copied.
+ </message>
</grit-part>
\ No newline at end of file