diff options
author | raymes <raymes@chromium.org> | 2015-08-03 11:05:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-03 18:06:28 +0000 |
commit | 93e1c532030428b7c6317eef8cf3b8fd37259a6f (patch) | |
tree | 9a91a0f4ed429f6474c2e32c02cb3c16e0ae530b /pdf/out_of_process_instance.cc | |
parent | f87ebd5381d93ab4540d66a525e6e1d058bd8f2b (diff) | |
download | chromium_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.cc | 5 |
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, |