
Currently, if some texts are selected and the PDF has restriction on copy action, the context menu won't display "copy" option for users due to the restriction. This might lead to users thinking PDF viewer is broken. To improve user experience, we want to always show copy option in the the context menu when texts are selected regardless of the copy restriction. And "copy" will be greyed out if copy restriction exists for that specific PDF to prevent copy action. This CL adds a new method HasCopyRestriction() in `WebPlugin` so that plugins can have copy permissions and selected text as two independent pieces of information. Then use the copy restriction to determine whether the "copy" option should be enabled inside the context menu. This CL also adds hello_world2_with_copy_restriction.pdf for testing PDFiumEngine::SelectText(). The test file was created by pdftk with an owner password "foo" and their copy permissions are exempted. Bug: 1195543 Change-Id: Ica26e60d53829a1d566661c87e96a5a7d81456b6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3710793 Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Commit-Queue: Nigi <nigi@chromium.org> Reviewed-by: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Cr-Commit-Position: refs/heads/main@{#1018381}
Chromium
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone
! Instead,
follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.