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

Unified Diff: pdf/out_of_process_instance.cc

Issue 375253002: [Chrome] Support NumCopies print preset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 1 month 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 | « pdf/out_of_process_instance.h ('k') | pdf/pdf_engine.h » ('j') | 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 92ef55003b3f22636b232e7a9df87466d8441a10..e195067015f7a1f005790070a014cd4b1528df13 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -166,9 +166,22 @@ void Transform(PP_Instance instance, PP_PrivatePageTransformType type) {
}
}
+PP_Bool GetPrintPresetOptionsFromDocument(
+ PP_Instance instance,
+ PP_PdfPrintPresetOptions_Dev* options) {
+ void* object = pp::Instance::GetPerInstanceObject(instance, kPPPPdfInterface);
+ if (object) {
+ OutOfProcessInstance* obj_instance =
+ static_cast<OutOfProcessInstance*>(object);
+ obj_instance->GetPrintPresetOptionsFromDocument(options);
+ }
+ return PP_TRUE;
+}
+
const PPP_Pdf ppp_private = {
&GetLinkAtPosition,
- &Transform
+ &Transform,
+ &GetPrintPresetOptionsFromDocument
};
int ExtractPrintPreviewPageIndex(const std::string& src_url) {
@@ -551,6 +564,12 @@ void OutOfProcessInstance::DidChangeView(const pp::View& view) {
}
}
+void OutOfProcessInstance::GetPrintPresetOptionsFromDocument(
+ PP_PdfPrintPresetOptions_Dev* options) {
+ options->is_scaling_disabled = PP_FromBool(IsPrintScalingDisabled());
+ options->copies = engine_->GetCopiesToPrint();
+}
+
pp::Var OutOfProcessInstance::GetLinkAtPosition(
const pp::Point& point) {
pp::Point offset_point(point);
« no previous file with comments | « pdf/out_of_process_instance.h ('k') | pdf/pdf_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698