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

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: Review feedback (rename from PPP_.. to PP_..) Created 6 years, 2 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 | « 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 d627dc2d7974f90a164714e0ddd0ad568cae8aa9..209f87a6638b22b18c05f49ea2d9fab4882c449c 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -165,9 +165,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) {
@@ -537,6 +550,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