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

Unified Diff: pdf/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/instance.h ('k') | pdf/out_of_process_instance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/instance.cc
diff --git a/pdf/instance.cc b/pdf/instance.cc
index fb8484fdbe748f39930ecdd6255f856dd423a927..a0feb5666545129bce5aa599f1721bd5abe4be36 100644
--- a/pdf/instance.cc
+++ b/pdf/instance.cc
@@ -217,9 +217,21 @@ 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) {
+ Instance* obj_instance = static_cast<Instance*>(object);
+ obj_instance->GetPrintPresetOptionsFromDocument(options);
+ }
+ return PP_TRUE;
+}
+
const PPP_Pdf ppp_private = {
&GetLinkAtPosition,
- &Transform
+ &Transform,
+ &GetPrintPresetOptionsFromDocument
};
int ExtractPrintPreviewPageIndex(const std::string& src_url) {
@@ -671,6 +683,12 @@ pp::Var Instance::GetInstanceObject() {
return instance_object_;
}
+void Instance::GetPrintPresetOptionsFromDocument(
+ PP_PdfPrintPresetOptions_Dev* options) {
+ options->is_scaling_disabled = PP_FromBool(IsPrintScalingDisabled());
+ options->copies = engine_->GetCopiesToPrint();
+}
+
pp::Var Instance::GetLinkAtPosition(const pp::Point& point) {
pp::Point offset_point(point);
ScalePoint(device_scale_, &offset_point);
« no previous file with comments | « pdf/instance.h ('k') | pdf/out_of_process_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698