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); |