Chromium Code Reviews| Index: pdf/out_of_process_instance.cc |
| diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc |
| index a385bb3aa93e8fcb8e1ff851786043c6d4bea994..34d3f5b3cba15f38b223ce9acd18b9b82fca5767 100644 |
| --- a/pdf/out_of_process_instance.cc |
| +++ b/pdf/out_of_process_instance.cc |
| @@ -134,7 +134,7 @@ const double kMinZoom = 0.01; |
| namespace { |
| -static const char kPPPPdfInterface[] = PPP_PDF_INTERFACE_1; |
| +static const char kPPPPdfInterface[] = PPP_PDF_INTERFACE_2; |
| PP_Var GetLinkAtPosition(PP_Instance instance, PP_Point point) { |
| pp::Var var; |
| @@ -163,9 +163,20 @@ void Transform(PP_Instance instance, PP_PrivatePageTransformType type) { |
| } |
| } |
| +PP_Bool GetPrintPresetOptionsFromDocument(PP_Instance instance, |
| + PP_PrintPresetOptions_Dev& options) { |
| + void* object = pp::Instance::GetPerInstanceObject(instance, kPPPPdfInterface); |
| + PP_Bool ret = PP_FALSE; |
| + if (object) |
| + ret = static_cast<OutOfProcessInstance*>(object) |
| + ->GetPrintPresetOptionsFromDocument(options); |
|
dmichael (off chromium)
2014/09/22 18:11:51
ditto, style looks off. just make an obj_instance
Nikhil
2014/09/23 10:32:28
Done.
|
| + return ret; |
| +} |
| + |
| const PPP_Pdf ppp_private = { |
| &GetLinkAtPosition, |
| - &Transform |
| + &Transform, |
| + &GetPrintPresetOptionsFromDocument |
| }; |
| int ExtractPrintPreviewPageIndex(const std::string& src_url) { |
| @@ -543,6 +554,14 @@ void OutOfProcessInstance::DidChangeView(const pp::View& view) { |
| } |
| } |
| +PP_Bool OutOfProcessInstance::GetPrintPresetOptionsFromDocument( |
| + PP_PrintPresetOptions_Dev& options) { |
| + options.is_scaling_disabled = PP_FromBool(IsPrintScalingDisabled()); |
| + options.copies = engine_->GetCopiesToPrint(); |
| + |
| + return PP_TRUE; |
| +} |
| + |
| pp::Var OutOfProcessInstance::GetLinkAtPosition( |
| const pp::Point& point) { |
| pp::Point offset_point(point); |