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

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 (oop proxy, out-param) Created 6 years, 3 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
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..79f4de0adf3286f05acf313766df236bf23e03f8 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_1_1;
PP_Var GetLinkAtPosition(PP_Instance instance, PP_Point point) {
pp::Var var;
@@ -163,9 +163,22 @@ 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) {
+ OutOfProcessInstance* obj_instance =
+ static_cast<OutOfProcessInstance*>(object);
+ ret = obj_instance->GetPrintPresetOptionsFromDocument(options);
+ }
+ return ret;
+}
+
const PPP_Pdf ppp_private = {
&GetLinkAtPosition,
- &Transform
+ &Transform,
+ &GetPrintPresetOptionsFromDocument
};
int ExtractPrintPreviewPageIndex(const std::string& src_url) {
@@ -543,6 +556,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;
raymes 2014/09/24 04:54:39 Same here.
Nikhil 2014/09/29 11:15:30 Acknowledged.
+}
+
pp::Var OutOfProcessInstance::GetLinkAtPosition(
const pp::Point& point) {
pp::Point offset_point(point);

Powered by Google App Engine
This is Rietveld 408576698