summaryrefslogtreecommitdiffstats
path: root/pdf/out_of_process_instance.cc
diff options
context:
space:
mode:
authorraymes <raymes@chromium.org>2015-08-03 11:05:55 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-03 18:06:28 +0000
commit93e1c532030428b7c6317eef8cf3b8fd37259a6f (patch)
tree9a91a0f4ed429f6474c2e32c02cb3c16e0ae530b /pdf/out_of_process_instance.cc
parentf87ebd5381d93ab4540d66a525e6e1d058bd8f2b (diff)
downloadchromium_src-93e1c532030428b7c6317eef8cf3b8fd37259a6f.zip
chromium_src-93e1c532030428b7c6317eef8cf3b8fd37259a6f.tar.gz
chromium_src-93e1c532030428b7c6317eef8cf3b8fd37259a6f.tar.bz2
Set the content restriction to disable printing in PDFs that disallow it
This sets the content restriction to properly disable printing for PDFs that don't allow printing. This ensures that ctrl+p doesn't print the document and also that the print menu item is disabled. BUG=515264 Review URL: https://codereview.chromium.org/1266303003 Cr-Commit-Position: refs/heads/master@{#341548}
Diffstat (limited to 'pdf/out_of_process_instance.cc')
-rw-r--r--pdf/out_of_process_instance.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index df881c5..df18f17 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -1130,6 +1130,11 @@ void OutOfProcessInstance::DocumentLoadComplete(int page_count) {
if (!engine_->HasPermission(PDFEngine::PERMISSION_COPY))
content_restrictions |= CONTENT_RESTRICTION_COPY;
+ if (!engine_->HasPermission(PDFEngine::PERMISSION_PRINT_LOW_QUALITY) &&
+ !engine_->HasPermission(PDFEngine::PERMISSION_PRINT_HIGH_QUALITY)) {
+ content_restrictions |= CONTENT_RESTRICTION_PRINT;
+ }
+
pp::PDF::SetContentRestriction(this, content_restrictions);
uma_.HistogramCustomCounts("PDF.PageCount", page_count,