Index: ppapi/cpp/dev/printing_dev.cc |
diff --git a/ppapi/cpp/dev/printing_dev.cc b/ppapi/cpp/dev/printing_dev.cc |
index 60154cd0d37f85f58d5e3115322cd56b67c6760d..ff31fde0a1bff43e723511111fc33cab8b2fba1b 100644 |
--- a/ppapi/cpp/dev/printing_dev.cc |
+++ b/ppapi/cpp/dev/printing_dev.cc |
@@ -65,13 +65,17 @@ PP_Bool IsScalingDisabled(PP_Instance instance) { |
return PP_FromBool(return_value); |
} |
-const PPP_Printing_Dev ppp_printing = { |
- &QuerySupportedFormats, |
- &Begin, |
- &PrintPages, |
- &End, |
- &IsScalingDisabled |
-}; |
+int32_t NumCopies(PP_Instance instance) { |
+ void* object = |
+ pp::Instance::GetPerInstanceObject(instance, kPPPPrintingInterface); |
+ if (!object) |
+ return 1; |
+ return static_cast<Printing_Dev*>(object)->GetNumCopies(); |
+} |
+ |
+const PPP_Printing_Dev ppp_printing = {&QuerySupportedFormats, &Begin, |
+ &PrintPages, &End, |
+ &IsScalingDisabled, &NumCopies}; |
} // namespace |