Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Unified Diff: pdf/out_of_process_instance.cc

Issue 1266303003: Set the content restriction to disable printing in PDFs that disallow it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/out_of_process_instance.cc
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index df881c5fada58a70748004cb95090572e325aea9..df18f17334f2cf6415cd98280d05c279a9a45717 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,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698